1 // SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 // SPDX-License-Identifier: LGPL-2.1-or-later
6 * Userspace RCU library - Stack with wait-free push, blocking traversal.
9 /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
10 #include "urcu/wfstack.h"
11 #include "urcu/static/wfstack.h"
14 * library wrappers to be used by non-LGPL compatible source code.
17 void cds_wfs_node_init(struct cds_wfs_node
*node
)
19 _cds_wfs_node_init(node
);
22 void cds_wfs_init(struct cds_wfs_stack
*s
)
27 void cds_wfs_destroy(struct cds_wfs_stack
*s
)
32 void __cds_wfs_init(struct __cds_wfs_stack
*s
)
37 bool cds_wfs_empty(cds_wfs_stack_const_ptr_t u_stack
)
39 return _cds_wfs_empty(u_stack
);
42 int cds_wfs_push(cds_wfs_stack_ptr_t u_stack
, struct cds_wfs_node
*node
)
44 return _cds_wfs_push(u_stack
, node
);
47 struct cds_wfs_node
*cds_wfs_pop_blocking(struct cds_wfs_stack
*s
)
49 return _cds_wfs_pop_blocking(s
);
53 cds_wfs_pop_with_state_blocking(struct cds_wfs_stack
*s
, int *state
)
55 return _cds_wfs_pop_with_state_blocking(s
, state
);
58 struct cds_wfs_head
*cds_wfs_pop_all_blocking(struct cds_wfs_stack
*s
)
60 return _cds_wfs_pop_all_blocking(s
);
63 struct cds_wfs_node
*cds_wfs_first(struct cds_wfs_head
*head
)
65 return _cds_wfs_first(head
);
68 struct cds_wfs_node
*cds_wfs_next_blocking(struct cds_wfs_node
*node
)
70 return _cds_wfs_next_blocking(node
);
73 struct cds_wfs_node
*cds_wfs_next_nonblocking(struct cds_wfs_node
*node
)
75 return _cds_wfs_next_nonblocking(node
);
78 void cds_wfs_pop_lock(struct cds_wfs_stack
*s
)
83 void cds_wfs_pop_unlock(struct cds_wfs_stack
*s
)
85 _cds_wfs_pop_unlock(s
);
88 struct cds_wfs_node
*__cds_wfs_pop_blocking(cds_wfs_stack_ptr_t u_stack
)
90 return ___cds_wfs_pop_blocking(u_stack
);
94 __cds_wfs_pop_with_state_blocking(cds_wfs_stack_ptr_t u_stack
,
97 return ___cds_wfs_pop_with_state_blocking(u_stack
, state
);
100 struct cds_wfs_node
*__cds_wfs_pop_nonblocking(cds_wfs_stack_ptr_t u_stack
)
102 return ___cds_wfs_pop_nonblocking(u_stack
);
105 struct cds_wfs_node
*
106 __cds_wfs_pop_with_state_nonblocking(cds_wfs_stack_ptr_t u_stack
,
109 return ___cds_wfs_pop_with_state_nonblocking(u_stack
, state
);
112 struct cds_wfs_head
*__cds_wfs_pop_all(cds_wfs_stack_ptr_t u_stack
)
114 return ___cds_wfs_pop_all(u_stack
);