From: Mathieu Desnoyers Date: Tue, 23 Oct 2012 12:43:33 +0000 (-0400) Subject: Deprecate wfqueue X-Git-Tag: v0.8.0~175 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=147485105cf7b5c8ea96d7f68df973b9c5a94e8e;p=urcu.git Deprecate wfqueue Replaced by "wfcqueue", which has a semantic that allows placing head and tail on different cache lines, and does not allocate memory internally. wfqueue users can easily migrate to wfcqueue. We choose to deprecate wfqueue rather than reimplementing it on top of wfcqueue to ensure we keep strong ABI compatibility for existing wfqueue users. Signed-off-by: Mathieu Desnoyers --- diff --git a/tests/test_urcu_wfq.c b/tests/test_urcu_wfq.c index b3f03b9..d176041 100644 --- a/tests/test_urcu_wfq.c +++ b/tests/test_urcu_wfq.c @@ -65,6 +65,10 @@ static inline pid_t gettid(void) #ifndef DYNAMIC_LINK_TEST #define _LGPL_SOURCE #endif + +/* Remove deprecation warnings from test build. */ +#define CDS_WFQ_DEPRECATED + #include #include diff --git a/urcu/wfqueue.h b/urcu/wfqueue.h index 03a73f1..342ee48 100644 --- a/urcu/wfqueue.h +++ b/urcu/wfqueue.h @@ -31,6 +31,11 @@ extern "C" { #endif +#ifndef CDS_WFQ_DEPRECATED +#define CDS_WFQ_DEPRECATED \ + __attribute__((deprecated("urcu/wfqueue.h is deprecated. Please use urcu/wfcqueue.h instead."))) +#endif + /* * Queue with wait-free enqueue/blocking dequeue. * This implementation adds a dummy head node when the queue is empty to ensure @@ -54,20 +59,53 @@ struct cds_wfq_queue { #include -#define cds_wfq_node_init _cds_wfq_node_init -#define cds_wfq_init _cds_wfq_init -#define cds_wfq_enqueue _cds_wfq_enqueue -#define __cds_wfq_dequeue_blocking ___cds_wfq_dequeue_blocking -#define cds_wfq_dequeue_blocking _cds_wfq_dequeue_blocking +static inline CDS_WFQ_DEPRECATED +void cds_wfq_node_init(struct cds_wfq_node *node) +{ + _cds_wfq_node_init(node); +} + +static inline CDS_WFQ_DEPRECATED +void cds_wfq_init(struct cds_wfq_queue *q) +{ + _cds_wfq_init(q); +} + +static inline CDS_WFQ_DEPRECATED +void cds_wfq_enqueue(struct cds_wfq_queue *q, struct cds_wfq_node *node) +{ + _cds_wfq_enqueue(q, node); +} + +static inline CDS_WFQ_DEPRECATED +struct cds_wfq_node *__cds_wfq_dequeue_blocking(struct cds_wfq_queue *q) +{ + return ___cds_wfq_dequeue_blocking(q); +} + +static inline CDS_WFQ_DEPRECATED +struct cds_wfq_node *cds_wfq_dequeue_blocking(struct cds_wfq_queue *q) +{ + return _cds_wfq_dequeue_blocking(q); +} #else /* !_LGPL_SOURCE */ -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); +extern CDS_WFQ_DEPRECATED +void cds_wfq_node_init(struct cds_wfq_node *node); + +extern CDS_WFQ_DEPRECATED +void cds_wfq_init(struct cds_wfq_queue *q); + +extern CDS_WFQ_DEPRECATED +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); +extern CDS_WFQ_DEPRECATED +struct cds_wfq_node *__cds_wfq_dequeue_blocking(struct cds_wfq_queue *q); + +extern CDS_WFQ_DEPRECATED +struct cds_wfq_node *cds_wfq_dequeue_blocking(struct cds_wfq_queue *q); #endif /* !_LGPL_SOURCE */ diff --git a/wfqueue.c b/wfqueue.c index 3337171..14272cb 100644 --- a/wfqueue.c +++ b/wfqueue.c @@ -20,6 +20,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +/* Remove deprecation warnings from LGPL wrapper build. */ +#define CDS_WFQ_DEPRECATED + /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ #include "urcu/wfqueue.h" #include "urcu/static/wfqueue.h"