- /*
- * Adaptative busy-looping waiting for enqueuer to complete enqueue.
- */
- while ((next = LOAD_SHARED(node->next)) == NULL) {
- if (busy_wait > 0) {
- cpu_relax();
- busy_wait--;
- } else
- poll(NULL, 0, 1); /* Wait for 1ms */
- }
- /*
- * Move queue head forward.
- */
- q->head = next;
- /*
- * Requeue dummy node if we just dequeued it.
- */
- if (node == &q->dummy) {
- wfq_node_init(node);
- wfq_enqueue(q, node);
- return __wfq_dequeue_blocking(q);
- }
- return node;
-}
-
-struct wfq_node *
-wfq_dequeue_blocking(struct wfq_queue *q)
-{
- struct wfq_node *retnode;
- int ret;
+extern void cds_wfq_node_init(struct cds_wfq_node *node);
+extern void cds_wfq_init(struct cds_wfq_queue *q);
+extern void cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node);
+/* __cds_wfq_dequeue_blocking: caller ensures mutual exclusion between dequeues */
+extern struct cds_wfq_node *__cds_wfq_dequeue_blocking(struct cds_wfq_queue *q);
+extern struct cds_wfq_node *cds_wfq_dequeue_blocking(struct cds_wfq_queue *q);