Fix: add missing destroy functions to queues/stack APIs
[userspace-rcu.git] / urcu / static / wfcqueue.h
index 62e003f98a4029a08f20e85b3a2c67f1b593ac03..0d2facbc212a89dceae359b181a3b421cc4c0292 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)
@@ -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.
  *
This page took 0.023601 seconds and 4 git commands to generate.