9 data.store(0, memory_order_normal);
10 next.store(0, wildcard(1));
18 atomic<node*> head, tail;
21 head = tail = new node(0);
24 void enqueue(int val) {
25 node* n = new node(val);
26 node *h = head.load(wildcard(2));
27 h->next.store(n, wildcard(3));
28 head.store(n, wildcard(4));
31 bool dequeue(int *v) {
32 node* t = tail.load(wildcard(5));
33 node* n = t->next.load(wildcard(6));
36 *v = n->data.load(memory_order_normal);
37 tail.store(n, wildcard(7));