Install urcu/map/*.h into system
[urcu.git] / urcu / wfqueue-static.h
index 4839c47a32d43030f4f39bad27b7b888c158a544..790931bef25db04d2156fe0cd39dd260b31a0474 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <pthread.h>
 #include <assert.h>
+#include <poll.h>
 #include <urcu/compiler.h>
 #include <urcu/uatomic_arch.h>
 
@@ -47,12 +48,12 @@ extern "C" {
 #define WFQ_ADAPT_ATTEMPTS             10      /* Retry if being set */
 #define WFQ_WAIT                       10      /* Wait 10 ms if being set */
 
-void _cds_wfq_node_init(struct cds_wfq_node *node)
+static inline void _cds_wfq_node_init(struct cds_wfq_node *node)
 {
        node->next = NULL;
 }
 
-void _cds_wfq_init(struct cds_wfq_queue *q)
+static inline void _cds_wfq_init(struct cds_wfq_queue *q)
 {
        int ret;
 
@@ -64,7 +65,8 @@ void _cds_wfq_init(struct cds_wfq_queue *q)
        assert(!ret);
 }
 
-void _cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node)
+static inline void _cds_wfq_enqueue(struct cds_wfq_queue *q,
+                                   struct cds_wfq_node *node)
 {
        struct cds_wfq_node **old_tail;
 
@@ -79,7 +81,7 @@ void _cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node)
         * that the queue is being appended to. The following store will append
         * "node" to the queue from a dequeuer perspective.
         */
-       CAA_STORE_SHARED(*old_tail, node);
+       CMM_STORE_SHARED(*old_tail, node);
 }
 
 /*
@@ -90,7 +92,7 @@ void _cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node)
  * thread to be scheduled. The queue appears empty until tail->next is set by
  * enqueue.
  */
-struct cds_wfq_node *
+static inline struct cds_wfq_node *
 ___cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
 {
        struct cds_wfq_node *node, *next;
@@ -99,14 +101,14 @@ ___cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
        /*
         * Queue is empty if it only contains the dummy node.
         */
-       if (q->head == &q->dummy && CAA_LOAD_SHARED(q->tail) == &q->dummy.next)
+       if (q->head == &q->dummy && CMM_LOAD_SHARED(q->tail) == &q->dummy.next)
                return NULL;
        node = q->head;
 
        /*
         * Adaptative busy-looping waiting for enqueuer to complete enqueue.
         */
-       while ((next = CAA_LOAD_SHARED(node->next)) == NULL) {
+       while ((next = CMM_LOAD_SHARED(node->next)) == NULL) {
                if (++attempt >= WFQ_ADAPT_ATTEMPTS) {
                        poll(NULL, 0, WFQ_WAIT);        /* Wait for 10ms */
                        attempt = 0;
@@ -128,7 +130,7 @@ ___cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
        return node;
 }
 
-struct cds_wfq_node *
+static inline struct cds_wfq_node *
 _cds_wfq_dequeue_blocking(struct cds_wfq_queue *q)
 {
        struct cds_wfq_node *retnode;
This page took 0.023339 seconds and 4 git commands to generate.