uatomic/x86: Remove redundant memory barriers
[urcu.git] / src / wfcqueue.c
1 // SPDX-FileCopyrightText: 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2 // SPDX-FileCopyrightText: 2011-2012 Lai Jiangshan <laijs@cn.fujitsu.com>
3 //
4 // SPDX-License-Identifier: LGPL-2.1-or-later
5
6 /*
7 * Userspace RCU library - Concurrent Queue with Wait-Free Enqueue/Blocking Dequeue
8 */
9
10 /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */
11 #include "urcu/wfcqueue.h"
12 #include "urcu/static/wfcqueue.h"
13
14 /*
15 * library wrappers to be used by non-LGPL compatible source code.
16 */
17
18 void cds_wfcq_node_init(struct cds_wfcq_node *node)
19 {
20 _cds_wfcq_node_init(node);
21 }
22
23 void cds_wfcq_init(struct cds_wfcq_head *head,
24 struct cds_wfcq_tail *tail)
25 {
26 _cds_wfcq_init(head, tail);
27 }
28
29 void cds_wfcq_destroy(struct cds_wfcq_head *head,
30 struct cds_wfcq_tail *tail)
31 {
32 _cds_wfcq_destroy(head, tail);
33 }
34
35 void __cds_wfcq_init(struct __cds_wfcq_head *head,
36 struct cds_wfcq_tail *tail)
37 {
38 ___cds_wfcq_init(head, tail);
39 }
40
41 bool cds_wfcq_empty(cds_wfcq_head_ptr_t head,
42 struct cds_wfcq_tail *tail)
43
44 {
45 return _cds_wfcq_empty(head, tail);
46 }
47
48 bool cds_wfcq_enqueue(cds_wfcq_head_ptr_t head,
49 struct cds_wfcq_tail *tail,
50 struct cds_wfcq_node *node)
51 {
52 return _cds_wfcq_enqueue(head, tail, node);
53 }
54
55 void cds_wfcq_dequeue_lock(struct cds_wfcq_head *head,
56 struct cds_wfcq_tail *tail)
57 {
58 _cds_wfcq_dequeue_lock(head, tail);
59 }
60
61 void cds_wfcq_dequeue_unlock(struct cds_wfcq_head *head,
62 struct cds_wfcq_tail *tail)
63 {
64 _cds_wfcq_dequeue_unlock(head, tail);
65 }
66
67 struct cds_wfcq_node *cds_wfcq_dequeue_blocking(
68 struct cds_wfcq_head *head,
69 struct cds_wfcq_tail *tail)
70 {
71 return _cds_wfcq_dequeue_blocking(head, tail);
72 }
73
74 struct cds_wfcq_node *cds_wfcq_dequeue_with_state_blocking(
75 struct cds_wfcq_head *head,
76 struct cds_wfcq_tail *tail,
77 int *state)
78 {
79 return _cds_wfcq_dequeue_with_state_blocking(head, tail, state);
80 }
81
82 enum cds_wfcq_ret cds_wfcq_splice_blocking(
83 struct cds_wfcq_head *dest_q_head,
84 struct cds_wfcq_tail *dest_q_tail,
85 struct cds_wfcq_head *src_q_head,
86 struct cds_wfcq_tail *src_q_tail)
87 {
88 return _cds_wfcq_splice_blocking(dest_q_head, dest_q_tail,
89 src_q_head, src_q_tail);
90 }
91
92 struct cds_wfcq_node *__cds_wfcq_dequeue_blocking(
93 cds_wfcq_head_ptr_t head,
94 struct cds_wfcq_tail *tail)
95 {
96 return ___cds_wfcq_dequeue_blocking(head, tail);
97 }
98
99 struct cds_wfcq_node *__cds_wfcq_dequeue_with_state_blocking(
100 cds_wfcq_head_ptr_t head,
101 struct cds_wfcq_tail *tail,
102 int *state)
103 {
104 return ___cds_wfcq_dequeue_with_state_blocking(head, tail, state);
105 }
106
107 struct cds_wfcq_node *__cds_wfcq_dequeue_nonblocking(
108 cds_wfcq_head_ptr_t head,
109 struct cds_wfcq_tail *tail)
110 {
111 return ___cds_wfcq_dequeue_nonblocking(head, tail);
112 }
113
114 struct cds_wfcq_node *__cds_wfcq_dequeue_with_state_nonblocking(
115 cds_wfcq_head_ptr_t head,
116 struct cds_wfcq_tail *tail,
117 int *state)
118 {
119 return ___cds_wfcq_dequeue_with_state_nonblocking(head, tail, state);
120 }
121
122 enum cds_wfcq_ret __cds_wfcq_splice_blocking(
123 cds_wfcq_head_ptr_t dest_q_head,
124 struct cds_wfcq_tail *dest_q_tail,
125 cds_wfcq_head_ptr_t src_q_head,
126 struct cds_wfcq_tail *src_q_tail)
127 {
128 return ___cds_wfcq_splice_blocking(dest_q_head, dest_q_tail,
129 src_q_head, src_q_tail);
130 }
131
132 enum cds_wfcq_ret __cds_wfcq_splice_nonblocking(
133 cds_wfcq_head_ptr_t dest_q_head,
134 struct cds_wfcq_tail *dest_q_tail,
135 cds_wfcq_head_ptr_t src_q_head,
136 struct cds_wfcq_tail *src_q_tail)
137 {
138 return ___cds_wfcq_splice_nonblocking(dest_q_head, dest_q_tail,
139 src_q_head, src_q_tail);
140 }
141
142 struct cds_wfcq_node *__cds_wfcq_first_blocking(
143 cds_wfcq_head_ptr_t head,
144 struct cds_wfcq_tail *tail)
145 {
146 return ___cds_wfcq_first_blocking(head, tail);
147 }
148
149 struct cds_wfcq_node *__cds_wfcq_first_nonblocking(
150 cds_wfcq_head_ptr_t head,
151 struct cds_wfcq_tail *tail)
152 {
153 return ___cds_wfcq_first_nonblocking(head, tail);
154 }
155
156 struct cds_wfcq_node *__cds_wfcq_next_blocking(
157 cds_wfcq_head_ptr_t head,
158 struct cds_wfcq_tail *tail,
159 struct cds_wfcq_node *node)
160 {
161 return ___cds_wfcq_next_blocking(head, tail, node);
162 }
163
164 struct cds_wfcq_node *__cds_wfcq_next_nonblocking(
165 cds_wfcq_head_ptr_t head,
166 struct cds_wfcq_tail *tail,
167 struct cds_wfcq_node *node)
168 {
169 return ___cds_wfcq_next_nonblocking(head, tail, node);
170 }
This page took 0.031784 seconds and 4 git commands to generate.