Commit | Line | Data |
---|---|---|
acdb82a2 MJ |
1 | // SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
2 | // | |
3 | // SPDX-License-Identifier: LGPL-2.1-or-later | |
4 | ||
294d3396 | 5 | /* |
edac6b69 | 6 | * Userspace RCU library - Stack with wait-free push, blocking traversal. |
294d3396 MD |
7 | */ |
8 | ||
9 | /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ | |
10 | #include "urcu/wfstack.h" | |
af7c2dbe | 11 | #include "urcu/static/wfstack.h" |
294d3396 | 12 | |
eaf2c3f4 MD |
13 | /* |
14 | * library wrappers to be used by non-LGPL compatible source code. | |
15 | */ | |
16 | ||
16aa9ee8 | 17 | void cds_wfs_node_init(struct cds_wfs_node *node) |
294d3396 | 18 | { |
16aa9ee8 | 19 | _cds_wfs_node_init(node); |
294d3396 MD |
20 | } |
21 | ||
16aa9ee8 | 22 | void cds_wfs_init(struct cds_wfs_stack *s) |
294d3396 | 23 | { |
16aa9ee8 | 24 | _cds_wfs_init(s); |
294d3396 MD |
25 | } |
26 | ||
200d100e MD |
27 | void cds_wfs_destroy(struct cds_wfs_stack *s) |
28 | { | |
29 | _cds_wfs_destroy(s); | |
30 | } | |
31 | ||
718eb63e EW |
32 | void __cds_wfs_init(struct __cds_wfs_stack *s) |
33 | { | |
34 | ___cds_wfs_init(s); | |
35 | } | |
36 | ||
711ff0f9 | 37 | bool cds_wfs_empty(cds_wfs_stack_ptr_t u_stack) |
edac6b69 | 38 | { |
711ff0f9 | 39 | return _cds_wfs_empty(u_stack); |
edac6b69 MD |
40 | } |
41 | ||
711ff0f9 | 42 | int cds_wfs_push(cds_wfs_stack_ptr_t u_stack, struct cds_wfs_node *node) |
294d3396 | 43 | { |
711ff0f9 | 44 | return _cds_wfs_push(u_stack, node); |
294d3396 MD |
45 | } |
46 | ||
edac6b69 MD |
47 | struct cds_wfs_node *cds_wfs_pop_blocking(struct cds_wfs_stack *s) |
48 | { | |
49 | return _cds_wfs_pop_blocking(s); | |
50 | } | |
51 | ||
c8975b94 MD |
52 | struct cds_wfs_node * |
53 | cds_wfs_pop_with_state_blocking(struct cds_wfs_stack *s, int *state) | |
54 | { | |
55 | return _cds_wfs_pop_with_state_blocking(s, state); | |
56 | } | |
57 | ||
edac6b69 MD |
58 | struct cds_wfs_head *cds_wfs_pop_all_blocking(struct cds_wfs_stack *s) |
59 | { | |
60 | return _cds_wfs_pop_all_blocking(s); | |
61 | } | |
62 | ||
c7ba06ba | 63 | struct cds_wfs_node *cds_wfs_first(struct cds_wfs_head *head) |
edac6b69 | 64 | { |
c7ba06ba | 65 | return _cds_wfs_first(head); |
edac6b69 MD |
66 | } |
67 | ||
68 | struct cds_wfs_node *cds_wfs_next_blocking(struct cds_wfs_node *node) | |
69 | { | |
70 | return _cds_wfs_next_blocking(node); | |
71 | } | |
72 | ||
af67624d MD |
73 | struct cds_wfs_node *cds_wfs_next_nonblocking(struct cds_wfs_node *node) |
74 | { | |
75 | return _cds_wfs_next_nonblocking(node); | |
76 | } | |
77 | ||
edac6b69 MD |
78 | void cds_wfs_pop_lock(struct cds_wfs_stack *s) |
79 | { | |
80 | _cds_wfs_pop_lock(s); | |
81 | } | |
82 | ||
83 | void cds_wfs_pop_unlock(struct cds_wfs_stack *s) | |
84 | { | |
85 | _cds_wfs_pop_unlock(s); | |
86 | } | |
87 | ||
711ff0f9 | 88 | struct cds_wfs_node *__cds_wfs_pop_blocking(cds_wfs_stack_ptr_t u_stack) |
294d3396 | 89 | { |
711ff0f9 | 90 | return ___cds_wfs_pop_blocking(u_stack); |
294d3396 MD |
91 | } |
92 | ||
c8975b94 | 93 | struct cds_wfs_node * |
711ff0f9 MD |
94 | __cds_wfs_pop_with_state_blocking(cds_wfs_stack_ptr_t u_stack, |
95 | int *state) | |
c8975b94 | 96 | { |
711ff0f9 | 97 | return ___cds_wfs_pop_with_state_blocking(u_stack, state); |
c8975b94 MD |
98 | } |
99 | ||
711ff0f9 | 100 | struct cds_wfs_node *__cds_wfs_pop_nonblocking(cds_wfs_stack_ptr_t u_stack) |
af67624d | 101 | { |
711ff0f9 | 102 | return ___cds_wfs_pop_nonblocking(u_stack); |
af67624d MD |
103 | } |
104 | ||
c8975b94 | 105 | struct cds_wfs_node * |
711ff0f9 | 106 | __cds_wfs_pop_with_state_nonblocking(cds_wfs_stack_ptr_t u_stack, |
c8975b94 MD |
107 | int *state) |
108 | { | |
711ff0f9 | 109 | return ___cds_wfs_pop_with_state_nonblocking(u_stack, state); |
c8975b94 MD |
110 | } |
111 | ||
718eb63e | 112 | struct cds_wfs_head *__cds_wfs_pop_all(cds_wfs_stack_ptr_t u_stack) |
294d3396 | 113 | { |
718eb63e | 114 | return ___cds_wfs_pop_all(u_stack); |
294d3396 | 115 | } |