add missing comment to wfstack.c
[urcu.git] / urcu / rculfqueue.h
index 09e5d41ea0db7b7f40032419b070ed55daecdfdd..d5c74288831d32e810a045fc068c668e7d60347f 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef _URCU_RCULFQUEUE_H
+#define _URCU_RCULFQUEUE_H
+
 /*
  * rculfqueue.h
  *
 #include <urcu/urcu_ref.h>
 #include <assert.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #if (!defined(_GNU_SOURCE) && !defined(_LGPL_SOURCE))
 #error "Dynamic loader LGPL wrappers not implemented yet"
 #endif
@@ -106,10 +113,12 @@ void rcu_lfq_enqueue(struct rcu_lfq_queue *q, struct rcu_lfq_node *node)
 /*
  * The entry returned by dequeue must be taken care of by doing a urcu_ref_put,
  * which calls the release primitive when the reference count drops to zero. A
- * grace period must be waited before performing the actual memory reclamation
- * in the release primitive.
- * The entry lfq node returned by dequeue must not be re-used before the
- * reference count reaches zero.
+ * grace period must be waited after execution of the release callback before
+ * performing the actual memory reclamation or modifying the rcu_lfq_node
+ * structure.
+ * In other words, the entry lfq node returned by dequeue must not be
+ * modified/re-used/freed until the reference count reaches zero and a grace
+ * period has elapsed (after the refcount reached 0).
  */
 struct rcu_lfq_node *
 rcu_lfq_dequeue(struct rcu_lfq_queue *q, void (*release)(struct urcu_ref *))
@@ -137,3 +146,9 @@ rcu_lfq_dequeue(struct rcu_lfq_queue *q, void (*release)(struct urcu_ref *))
                }
        }
 }
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _URCU_RCULFQUEUE_H */
This page took 0.022747 seconds and 4 git commands to generate.