1 // SPDX-FileCopyrightText: 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 // SPDX-License-Identifier: LGPL-2.1-or-later
5 #ifndef _URCU_RCULFSTACK_H
6 #define _URCU_RCULFSTACK_H
9 * Userspace RCU library - Lock-Free RCU Stack
12 #include <urcu/compiler.h>
18 #ifndef CDS_LFS_RCU_DEPRECATED
19 #define CDS_LFS_RCU_DEPRECATED \
20 CDS_DEPRECATED("urcu/rculfstack.h is deprecated. Please use urcu/lfstack.h instead.")
23 struct cds_lfs_node_rcu
{
24 struct cds_lfs_node_rcu
*next
;
27 struct cds_lfs_stack_rcu
{
28 struct cds_lfs_node_rcu
*head
;
33 #include <urcu/static/rculfstack.h>
35 static inline CDS_LFS_RCU_DEPRECATED
36 void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu
*node
)
38 _cds_lfs_node_init_rcu(node
);
42 void cds_lfs_init_rcu(struct cds_lfs_stack_rcu
*s
)
47 static inline CDS_LFS_RCU_DEPRECATED
48 int cds_lfs_push_rcu(struct cds_lfs_stack_rcu
*s
,
49 struct cds_lfs_node_rcu
*node
)
51 return _cds_lfs_push_rcu(s
, node
);
54 static inline CDS_LFS_RCU_DEPRECATED
55 struct cds_lfs_node_rcu
*cds_lfs_pop_rcu(struct cds_lfs_stack_rcu
*s
)
57 return _cds_lfs_pop_rcu(s
);
60 #else /* !_LGPL_SOURCE */
62 extern CDS_LFS_RCU_DEPRECATED
63 void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu
*node
);
64 extern CDS_LFS_RCU_DEPRECATED
65 void cds_lfs_init_rcu(struct cds_lfs_stack_rcu
*s
);
66 extern CDS_LFS_RCU_DEPRECATED
67 int cds_lfs_push_rcu(struct cds_lfs_stack_rcu
*s
,
68 struct cds_lfs_node_rcu
*node
);
71 * Should be called under rcu read lock critical section.
73 * The caller must wait for a grace period to pass before freeing the returned
74 * node or modifying the cds_lfs_node_rcu structure.
75 * Returns NULL if stack is empty.
77 extern CDS_LFS_RCU_DEPRECATED
78 struct cds_lfs_node_rcu
*cds_lfs_pop_rcu(struct cds_lfs_stack_rcu
*s
);
80 #endif /* !_LGPL_SOURCE */
86 #endif /* _URCU_RCULFSTACK_H */
This page took 0.037708 seconds and 4 git commands to generate.