X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fwfqueue-static.h;h=d0db3fc616dc00f21e43b8c1dbd4e376f5f8ff5e;hp=8a4a7fd8e2017d405f43e1b59de86dafb9ec4c99;hb=06f22bdbb0c4c4d5db42a2e2dc35818aa61415be;hpb=4d001e962e4f54d5128ac55bf03fdef77e41aa58 diff --git a/urcu/wfqueue-static.h b/urcu/wfqueue-static.h index 8a4a7fd..d0db3fc 100644 --- a/urcu/wfqueue-static.h +++ b/urcu/wfqueue-static.h @@ -79,7 +79,7 @@ void _wfq_enqueue(struct wfq_queue *q, struct wfq_node *node) * that the queue is being appended to. The following store will append * "node" to the queue from a dequeuer perspective. */ - STORE_SHARED(*old_tail, node); + CAA_STORE_SHARED(*old_tail, node); } /* @@ -91,7 +91,7 @@ void _wfq_enqueue(struct wfq_queue *q, struct wfq_node *node) * enqueue. */ struct wfq_node * -__wfq_dequeue_blocking(struct wfq_queue *q) +___wfq_dequeue_blocking(struct wfq_queue *q) { struct wfq_node *node, *next; int attempt = 0; @@ -99,19 +99,19 @@ __wfq_dequeue_blocking(struct wfq_queue *q) /* * Queue is empty if it only contains the dummy node. */ - if (q->head == &q->dummy && LOAD_SHARED(q->tail) == &q->dummy.next) + if (q->head == &q->dummy && CAA_LOAD_SHARED(q->tail) == &q->dummy.next) return NULL; node = q->head; /* * Adaptative busy-looping waiting for enqueuer to complete enqueue. */ - while ((next = LOAD_SHARED(node->next)) == NULL) { + while ((next = CAA_LOAD_SHARED(node->next)) == NULL) { if (++attempt >= WFQ_ADAPT_ATTEMPTS) { poll(NULL, 0, WFQ_WAIT); /* Wait for 10ms */ attempt = 0; } else - cpu_relax(); + caa_cpu_relax(); } /* * Move queue head forward. @@ -123,7 +123,7 @@ __wfq_dequeue_blocking(struct wfq_queue *q) if (node == &q->dummy) { _wfq_node_init(node); _wfq_enqueue(q, node); - return __wfq_dequeue_blocking(q); + return ___wfq_dequeue_blocking(q); } return node; } @@ -136,7 +136,7 @@ _wfq_dequeue_blocking(struct wfq_queue *q) ret = pthread_mutex_lock(&q->lock); assert(!ret); - retnode = __wfq_dequeue_blocking(q); + retnode = ___wfq_dequeue_blocking(q); ret = pthread_mutex_unlock(&q->lock); assert(!ret); return retnode;