MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / push

Method push

3rdparty/asyncplusplus/src/fifo_queue.h:45–60  ·  view source on GitHub ↗

Push a task to the end of the queue

Source from the content-addressed store, hash-verified

43
44 // Push a task to the end of the queue
45 void push(task_run_handle t)
46 {
47 // Resize queue if it is full
48 if (head == ((tail + 1) & (items.size() - 1))) {
49 detail::aligned_array<void*, LIBASYNC_CACHELINE_SIZE> new_items(items.size() * 2);
50 for (std::size_t i = 0; i != items.size(); i++)
51 new_items[i] = items[(i + head) & (items.size() - 1)];
52 head = 0;
53 tail = items.size() - 1;
54 items = std::move(new_items);
55 }
56
57 // Push the item
58 items[tail] = t.to_void_ptr();
59 tail = (tail + 1) & (items.size() - 1);
60 }
61
62 // Pop a task from the front of the queue
63 task_run_handle pop()

Callers 5

scheduleMethod · 0.45
scheduleMethod · 0.45
saveMethod · 0.45
axisRectsMethod · 0.45
selectedLegendsMethod · 0.45

Calls 2

to_void_ptrMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected