MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / push

Method push

tests/relacy/relacy/example/stack/stack.cpp:16–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14 }
15
16 void push(int data)
17 {
18 rl::var<node*> n = new node ();
19 n($)->data_($) = data;
20 node* next = head_.load(rl::memory_order_relaxed);
21 for (;;)
22 {
23 n($)->next_.store(next, rl::memory_order_relaxed);
24 if (head_.compare_exchange_weak(next, n($), rl::memory_order_release))
25 break;
26 }
27 }
28
29 int pop()
30 {

Callers 1

threadMethod · 0.45

Calls 3

loadMethod · 0.45
storeMethod · 0.45
compare_exchange_weakMethod · 0.45

Tested by

no test coverage detected