uatomic/x86: Remove redundant memory barriers
[urcu.git] / src / wfcqueue.c
CommitLineData
acdb82a2
MJ
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
8ad4ce58 6/*
f878b49e 7 * Userspace RCU library - Concurrent Queue with Wait-Free Enqueue/Blocking Dequeue
8ad4ce58
MD
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
18void cds_wfcq_node_init(struct cds_wfcq_node *node)
19{
20 _cds_wfcq_node_init(node);
21}
22
23void cds_wfcq_init(struct cds_wfcq_head *head,
24 struct cds_wfcq_tail *tail)
25{
26 _cds_wfcq_init(head, tail);
27}
28
200d100e
MD
29void cds_wfcq_destroy(struct cds_wfcq_head *head,
30 struct cds_wfcq_tail *tail)
31{
32 _cds_wfcq_destroy(head, tail);
33}
34
f637f191
MD
35void __cds_wfcq_init(struct __cds_wfcq_head *head,
36 struct cds_wfcq_tail *tail)
37{
38 ___cds_wfcq_init(head, tail);
39}
40
41bool cds_wfcq_empty(cds_wfcq_head_ptr_t head,
8ad4ce58
MD
42 struct cds_wfcq_tail *tail)
43
44{
45 return _cds_wfcq_empty(head, tail);
46}
47
f637f191 48bool cds_wfcq_enqueue(cds_wfcq_head_ptr_t head,
8ad4ce58
MD
49 struct cds_wfcq_tail *tail,
50 struct cds_wfcq_node *node)
51{
23773356 52 return _cds_wfcq_enqueue(head, tail, node);
8ad4ce58
MD
53}
54
55void cds_wfcq_dequeue_lock(struct cds_wfcq_head *head,
56 struct cds_wfcq_tail *tail)
57{
852a17ad 58 _cds_wfcq_dequeue_lock(head, tail);
8ad4ce58
MD
59}
60
61void cds_wfcq_dequeue_unlock(struct cds_wfcq_head *head,
62 struct cds_wfcq_tail *tail)
63{
852a17ad 64 _cds_wfcq_dequeue_unlock(head, tail);
8ad4ce58
MD
65}
66
67struct 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
eec791af
MD
74struct 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
23773356 82enum cds_wfcq_ret cds_wfcq_splice_blocking(
8ad4ce58
MD
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{
23773356 88 return _cds_wfcq_splice_blocking(dest_q_head, dest_q_tail,
8ad4ce58
MD
89 src_q_head, src_q_tail);
90}
91
92struct cds_wfcq_node *__cds_wfcq_dequeue_blocking(
f637f191 93 cds_wfcq_head_ptr_t head,
8ad4ce58
MD
94 struct cds_wfcq_tail *tail)
95{
96 return ___cds_wfcq_dequeue_blocking(head, tail);
97}
98
eec791af 99struct cds_wfcq_node *__cds_wfcq_dequeue_with_state_blocking(
f637f191 100 cds_wfcq_head_ptr_t head,
eec791af
MD
101 struct cds_wfcq_tail *tail,
102 int *state)
103{
104 return ___cds_wfcq_dequeue_with_state_blocking(head, tail, state);
105}
106
47215721 107struct cds_wfcq_node *__cds_wfcq_dequeue_nonblocking(
f637f191 108 cds_wfcq_head_ptr_t head,
47215721
MD
109 struct cds_wfcq_tail *tail)
110{
111 return ___cds_wfcq_dequeue_nonblocking(head, tail);
112}
113
eec791af 114struct cds_wfcq_node *__cds_wfcq_dequeue_with_state_nonblocking(
f637f191 115 cds_wfcq_head_ptr_t head,
eec791af
MD
116 struct cds_wfcq_tail *tail,
117 int *state)
118{
119 return ___cds_wfcq_dequeue_with_state_nonblocking(head, tail, state);
120}
121
23773356 122enum cds_wfcq_ret __cds_wfcq_splice_blocking(
f637f191 123 cds_wfcq_head_ptr_t dest_q_head,
8ad4ce58 124 struct cds_wfcq_tail *dest_q_tail,
f637f191 125 cds_wfcq_head_ptr_t src_q_head,
8ad4ce58
MD
126 struct cds_wfcq_tail *src_q_tail)
127{
23773356 128 return ___cds_wfcq_splice_blocking(dest_q_head, dest_q_tail,
8ad4ce58
MD
129 src_q_head, src_q_tail);
130}
131
23773356 132enum cds_wfcq_ret __cds_wfcq_splice_nonblocking(
f637f191 133 cds_wfcq_head_ptr_t dest_q_head,
47215721 134 struct cds_wfcq_tail *dest_q_tail,
f637f191 135 cds_wfcq_head_ptr_t src_q_head,
47215721
MD
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
8ad4ce58 142struct cds_wfcq_node *__cds_wfcq_first_blocking(
f637f191 143 cds_wfcq_head_ptr_t head,
8ad4ce58
MD
144 struct cds_wfcq_tail *tail)
145{
146 return ___cds_wfcq_first_blocking(head, tail);
147}
148
47215721 149struct cds_wfcq_node *__cds_wfcq_first_nonblocking(
f637f191 150 cds_wfcq_head_ptr_t head,
47215721
MD
151 struct cds_wfcq_tail *tail)
152{
153 return ___cds_wfcq_first_nonblocking(head, tail);
154}
155
8ad4ce58 156struct cds_wfcq_node *__cds_wfcq_next_blocking(
f637f191 157 cds_wfcq_head_ptr_t head,
8ad4ce58
MD
158 struct cds_wfcq_tail *tail,
159 struct cds_wfcq_node *node)
160{
161 return ___cds_wfcq_next_blocking(head, tail, node);
162}
47215721
MD
163
164struct cds_wfcq_node *__cds_wfcq_next_nonblocking(
f637f191 165 cds_wfcq_head_ptr_t head,
47215721
MD
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.047885 seconds and 4 git commands to generate.