Fix: add missing destroy functions to queues/stack APIs
[userspace-rcu.git] / urcu / static / wfstack.h
index db0d5b8b1abda178f7cf0e14a0530d5bae43f8aa..9efba0ee6185051c41d2816b0653d2b4191c78e3 100644 (file)
@@ -77,7 +77,8 @@ void _cds_wfs_node_init(struct cds_wfs_node *node)
 }
 
 /*
- * cds_wfs_init: initialize wait-free stack.
+ * cds_wfs_init: initialize wait-free stack. Pair with
+ * cds_wfs_destroy().
  */
 static inline
 void _cds_wfs_init(struct cds_wfs_stack *s)
@@ -89,6 +90,17 @@ void _cds_wfs_init(struct cds_wfs_stack *s)
        assert(!ret);
 }
 
+/*
+ * cds_wfs_destroy: destroy wait-free stack. Pair with
+ * cds_wfs_init().
+ */
+static inline
+void _cds_wfs_destroy(struct cds_wfs_stack *s)
+{
+       int ret = pthread_mutex_destroy(&s->lock);
+       assert(!ret);
+}
+
 static inline bool ___cds_wfs_end(void *node)
 {
        return node == CDS_WFS_END;
This page took 0.0238 seconds and 4 git commands to generate.