Fix: add missing destroy functions to queues/stack APIs
[urcu.git] / urcu / static / wfcqueue.h
index 4ababbf0ee8e99974f585c1f3b236381a8f60b3c..67ac05ffd15e384dc42317e0d5b4d0c93d71c2d6 100644 (file)
@@ -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)
This page took 0.023743 seconds and 4 git commands to generate.