6 #define release memory_order_release
7 #define acquire memory_order_acquire
8 #define acq_rel memory_order_acq_rel
9 #define relaxed memory_order_relaxed
13 // This field does not have to be atomic, but in the inference analysis, we
14 // might have a data race for this field without the proper synchronization.
18 node(unsigned int v) {
28 atomic_init(&top, NULL);
31 void push(unsigned int val) {
32 node *n = new node(val);
33 node *old = top.load(wildcard(1)); // acquire
36 n->next.store(old, wildcard(2));
37 } while (!top.compare_exchange_strong(old, n, wildcard(3), wildcard(4)));
42 node *old = top.load(wildcard(5)); // acquire
48 n = old->next.load(relaxed);
49 } while (!top.compare_exchange_strong(old, n, wildcard(6), wildcard(7)));