Fix: add missing destroy functions to queues/stack APIs
[userspace-rcu.git] / urcu / static / lfstack.h
index b49eb205a45ab3e5f409fc2ee9c490aa04e73e0e..967071a0cffcf74ba86465362efb7ae1fb17514f 100644 (file)
@@ -66,7 +66,8 @@ void _cds_lfs_node_init(struct cds_lfs_node *node)
 }
 
 /*
- * cds_lfs_init: initialize lock-free stack.
+ * cds_lfs_init: initialize lock-free stack (with lock). Pair with
+ * cds_lfs_destroy().
  */
 static inline
 void _cds_lfs_init(struct cds_lfs_stack *s)
@@ -78,6 +79,17 @@ void _cds_lfs_init(struct cds_lfs_stack *s)
        assert(!ret);
 }
 
+/*
+ * cds_lfs_destroy: destroy lock-free stack (with lock). Pair with
+ * cds_lfs_init().
+ */
+static inline
+void _cds_lfs_destroy(struct cds_lfs_stack *s)
+{
+        int ret = pthread_mutex_destroy(&s->lock);
+       assert(!ret);
+}
+
 static inline
 bool ___cds_lfs_empty_head(struct cds_lfs_head *head)
 {
This page took 0.024705 seconds and 4 git commands to generate.