1 #ifndef _URCU_RCULFSTACK_H
2 #define _URCU_RCULFSTACK_H
7 * Userspace RCU library - Lock-Free RCU Stack
9 * Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <urcu/compiler.h>
32 #ifndef CDS_LFS_RCU_DEPRECATED
33 #define CDS_LFS_RCU_DEPRECATED \
34 CDS_DEPRECATED("urcu/rculfstack.h is deprecated. Please use urcu/lfstack.h instead.")
37 struct cds_lfs_node_rcu
{
38 struct cds_lfs_node_rcu
*next
;
41 struct cds_lfs_stack_rcu
{
42 struct cds_lfs_node_rcu
*head
;
47 #include <urcu/static/rculfstack.h>
49 static inline CDS_LFS_RCU_DEPRECATED
50 void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu
*node
)
52 _cds_lfs_node_init_rcu(node
);
56 void cds_lfs_init_rcu(struct cds_lfs_stack_rcu
*s
)
61 static inline CDS_LFS_RCU_DEPRECATED
62 int cds_lfs_push_rcu(struct cds_lfs_stack_rcu
*s
,
63 struct cds_lfs_node_rcu
*node
)
65 return _cds_lfs_push_rcu(s
, node
);
68 static inline CDS_LFS_RCU_DEPRECATED
69 struct cds_lfs_node_rcu
*cds_lfs_pop_rcu(struct cds_lfs_stack_rcu
*s
)
71 return _cds_lfs_pop_rcu(s
);
74 #else /* !_LGPL_SOURCE */
76 extern CDS_LFS_RCU_DEPRECATED
77 void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu
*node
);
78 extern CDS_LFS_RCU_DEPRECATED
79 void cds_lfs_init_rcu(struct cds_lfs_stack_rcu
*s
);
80 extern CDS_LFS_RCU_DEPRECATED
81 int cds_lfs_push_rcu(struct cds_lfs_stack_rcu
*s
,
82 struct cds_lfs_node_rcu
*node
);
85 * Should be called under rcu read lock critical section.
87 * The caller must wait for a grace period to pass before freeing the returned
88 * node or modifying the cds_lfs_node_rcu structure.
89 * Returns NULL if stack is empty.
91 extern CDS_LFS_RCU_DEPRECATED
92 struct cds_lfs_node_rcu
*cds_lfs_pop_rcu(struct cds_lfs_stack_rcu
*s
);
94 #endif /* !_LGPL_SOURCE */
100 #endif /* _URCU_RCULFSTACK_H */
This page took 0.030359 seconds and 4 git commands to generate.