X-Git-Url: https://git.lttng.org/?p=urcu.git;a=blobdiff_plain;f=urcu%2Fstatic%2Fwfcqueue.h;h=67ac05ffd15e384dc42317e0d5b4d0c93d71c2d6;hp=4ababbf0ee8e99974f585c1f3b236381a8f60b3c;hb=200d100e05ed8e10c47f971939042f2406df92ef;hpb=b4edfa8157bb45827c3236809e550b4d13c0ae22 diff --git a/urcu/static/wfcqueue.h b/urcu/static/wfcqueue.h index 4ababbf..67ac05f 100644 --- a/urcu/static/wfcqueue.h +++ b/urcu/static/wfcqueue.h @@ -92,7 +92,8 @@ static inline void _cds_wfcq_node_init(struct cds_wfcq_node *node) } /* - * cds_wfcq_init: initialize wait-free queue. + * cds_wfcq_init: initialize wait-free queue (with lock). Pair with + * cds_wfcq_destroy(). */ static inline void _cds_wfcq_init(struct cds_wfcq_head *head, struct cds_wfcq_tail *tail) @@ -107,7 +108,19 @@ static inline void _cds_wfcq_init(struct cds_wfcq_head *head, } /* - * __cds_wfcq_init: initialize wait-free queue. + * cds_wfcq_destroy: destroy wait-free queue (with lock). Pair with + * cds_wfcq_init(). + */ +static inline void _cds_wfcq_destroy(struct cds_wfcq_head *head, + struct cds_wfcq_tail *tail) +{ + int ret = pthread_mutex_destroy(&head->lock); + assert(!ret); +} + +/* + * __cds_wfcq_init: initialize wait-free queue (without lock). Don't + * pair with any destroy function. */ static inline void ___cds_wfcq_init(struct __cds_wfcq_head *head, struct cds_wfcq_tail *tail)