Deprecate rculfstack
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Oct 2012 12:36:42 +0000 (08:36 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 23 Oct 2012 12:36:42 +0000 (08:36 -0400)
Replaced by "lfstack", which has a less restrictive semantic, and covers
rculfstack completely.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfstack.c
tests/test_urcu_lfs_rcu.c
urcu/rculfstack.h

index 574ea874265b316f9aed44ce998c16a034f3c585..df5c54703820461766b6cc18bf7f961812cad8b7 100644 (file)
@@ -20,6 +20,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+/* Remove deprecation warnings from LGPL wrapper build. */
+#define CDS_LFS_RCU_DEPRECATED
+
 /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
 #undef _LGPL_SOURCE
 #include "urcu/rculfstack.h"
index d1e0ee9a8a7ad101d9206dc5dd6e0e2ab8c6038d..c356d1db0bce24531d1e644bb85a3bdcd2314cd6 100644 (file)
@@ -66,6 +66,10 @@ static inline pid_t gettid(void)
 #define _LGPL_SOURCE
 #endif
 #include <urcu.h>
+
+/* Remove deprecation warnings from test build. */
+#define CDS_LFS_RCU_DEPRECATED
+
 #include <urcu/cds.h>
 
 static volatile int test_go, test_stop;
index 93c0bc92f82544043906d3aca51dc63d6d7995c9..2d1ecceba729524700804f85821a73c03c1d0ba0 100644 (file)
 extern "C" {
 #endif
 
+#ifndef CDS_LFS_RCU_DEPRECATED
+#define CDS_LFS_RCU_DEPRECATED \
+       __attribute__((deprecated("urcu/rculfstack.h is deprecated. Please use urcu/lfstack.h instead.")))
+#endif
+
 struct cds_lfs_node_rcu {
        struct cds_lfs_node_rcu *next;
 };
@@ -39,16 +44,39 @@ struct cds_lfs_stack_rcu {
 
 #include <urcu/static/rculfstack.h>
 
-#define cds_lfs_node_init_rcu          _cds_lfs_node_init_rcu
-#define cds_lfs_init_rcu               _cds_lfs_init_rcu
-#define cds_lfs_push_rcu               _cds_lfs_push_rcu
-#define cds_lfs_pop_rcu                        _cds_lfs_pop_rcu
+static inline CDS_LFS_RCU_DEPRECATED
+void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node)
+{
+       _cds_lfs_node_init_rcu(node);
+}
+
+static inline
+void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s)
+{
+       _cds_lfs_init_rcu(s);
+}
+
+static inline CDS_LFS_RCU_DEPRECATED
+int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
+                       struct cds_lfs_node_rcu *node)
+{
+       return _cds_lfs_push_rcu(s, node);
+}
+
+static inline CDS_LFS_RCU_DEPRECATED
+struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s)
+{
+       return _cds_lfs_pop_rcu(s);
+}
 
 #else /* !_LGPL_SOURCE */
 
-extern void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node);
-extern void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s);
-extern int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
+extern CDS_LFS_RCU_DEPRECATED
+void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node);
+extern CDS_LFS_RCU_DEPRECATED
+void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s);
+extern CDS_LFS_RCU_DEPRECATED
+int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
                        struct cds_lfs_node_rcu *node);
 
 /*
@@ -58,7 +86,8 @@ extern int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
  * node or modifying the cds_lfs_node_rcu structure.
  * Returns NULL if stack is empty.
  */
-extern struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s);
+extern CDS_LFS_RCU_DEPRECATED
+struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s);
 
 #endif /* !_LGPL_SOURCE */
 
This page took 0.02684 seconds and 4 git commands to generate.