X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu%2Fstatic%2Fwfcqueue.h;h=0d2facbc212a89dceae359b181a3b421cc4c0292;hb=93aee570e96c48843659caa12667ff7157734532;hp=62e003f98a4029a08f20e85b3a2c67f1b593ac03;hpb=96bd49dfcb6476da907cf7ebd9e245014879e9f2;p=userspace-rcu.git diff --git a/urcu/static/wfcqueue.h b/urcu/static/wfcqueue.h index 62e003f..0d2facb 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) @@ -106,6 +107,17 @@ static inline void _cds_wfcq_init(struct cds_wfcq_head *head, assert(!ret); } +/* + * 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_empty: return whether wait-free queue is empty. *