X-Git-Url: http://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Frcuwfqueue.h;h=8c1d4a19c2ef573eaaf383952cca30c8b8138a3a;hp=857233b90b2f8c3d02b746f2508191b55cb62dc0;hb=0e2e9380d93d73c246abdeef52c7a97b01deecca;hpb=ad918eeb98d1ac8b12015050ee60b488e850ac0d diff --git a/urcu/rcuwfqueue.h b/urcu/rcuwfqueue.h index 857233b..8c1d4a1 100644 --- a/urcu/rcuwfqueue.h +++ b/urcu/rcuwfqueue.h @@ -1,3 +1,6 @@ +#ifndef _URCU_RCUWFQUEUE_H +#define _URCU_RCUWFQUEUE_H + /* * rcuwfqueue.h * @@ -23,6 +26,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + #if (!defined(_GNU_SOURCE) && !defined(_LGPL_SOURCE)) #error "Dynamic loader LGPL wrappers not implemented yet" #endif @@ -92,8 +99,10 @@ void rcu_wfq_enqueue(struct rcu_wfq_queue *q, struct rcu_wfq_node *node) * modified/re-used/freed until the reference count reaches zero and a grace * period has elapsed (after the refcount reached 0). * - * TODO: implement adaptative busy-wait and wait/wakeup scheme rather than busy - * loops. Better for UP. + * No need to go on a waitqueue here, as there is no possible state in which the + * list could cause dequeue to busy-loop needlessly while waiting for another + * thread to be scheduled. The queue appears empty until tail->next is set by + * enqueue. */ struct rcu_wfq_node * rcu_wfq_dequeue_blocking(struct rcu_wfq_queue *q, @@ -122,3 +131,9 @@ rcu_wfq_dequeue_blocking(struct rcu_wfq_queue *q, } } } + +#ifdef __cplusplus +} +#endif + +#endif /* _URCU_RCUWFQUEUE_H */