| 1 | // SPDX-FileCopyrightText: 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| 2 | // |
| 3 | // SPDX-License-Identifier: LGPL-2.1-or-later |
| 4 | |
| 5 | /* |
| 6 | * Userspace RCU library - Lock-Free RCU Queue |
| 7 | */ |
| 8 | |
| 9 | /* Do not #define _LGPL_SOURCE to ensure we can emit the wrapper symbols */ |
| 10 | #undef _LGPL_SOURCE |
| 11 | #include "urcu/rculfqueue.h" |
| 12 | #define _LGPL_SOURCE |
| 13 | #include "urcu/static/rculfqueue.h" |
| 14 | |
| 15 | /* |
| 16 | * library wrappers to be used by non-LGPL compatible source code. |
| 17 | */ |
| 18 | |
| 19 | void cds_lfq_node_init_rcu(struct cds_lfq_node_rcu *node) |
| 20 | { |
| 21 | _cds_lfq_node_init_rcu(node); |
| 22 | } |
| 23 | |
| 24 | void cds_lfq_init_rcu(struct cds_lfq_queue_rcu *q, |
| 25 | void queue_call_rcu(struct rcu_head *head, |
| 26 | void (*func)(struct rcu_head *head))) |
| 27 | { |
| 28 | _cds_lfq_init_rcu(q, queue_call_rcu); |
| 29 | } |
| 30 | |
| 31 | int cds_lfq_destroy_rcu(struct cds_lfq_queue_rcu *q) |
| 32 | { |
| 33 | return _cds_lfq_destroy_rcu(q); |
| 34 | } |
| 35 | |
| 36 | void cds_lfq_enqueue_rcu(struct cds_lfq_queue_rcu *q, struct cds_lfq_node_rcu *node) |
| 37 | { |
| 38 | _cds_lfq_enqueue_rcu(q, node); |
| 39 | } |
| 40 | |
| 41 | struct cds_lfq_node_rcu * |
| 42 | cds_lfq_dequeue_rcu(struct cds_lfq_queue_rcu *q) |
| 43 | { |
| 44 | return _cds_lfq_dequeue_rcu(q); |
| 45 | } |