fix: handle EINTR correctly in get_cpu_mask_from_sysfs
[urcu.git] / include / urcu / rculfstack.h
... / ...
CommitLineData
1// SPDX-FileCopyrightText: 2010 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef _URCU_RCULFSTACK_H
6#define _URCU_RCULFSTACK_H
7
8/*
9 * Userspace RCU library - Lock-Free RCU Stack
10 */
11
12#include <urcu/compiler.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#ifndef CDS_LFS_RCU_DEPRECATED
19#define CDS_LFS_RCU_DEPRECATED \
20 CDS_DEPRECATED("urcu/rculfstack.h is deprecated. Please use urcu/lfstack.h instead.")
21#endif
22
23struct cds_lfs_node_rcu {
24 struct cds_lfs_node_rcu *next;
25};
26
27struct cds_lfs_stack_rcu {
28 struct cds_lfs_node_rcu *head;
29};
30
31#ifdef _LGPL_SOURCE
32
33#include <urcu/static/rculfstack.h>
34
35static inline CDS_LFS_RCU_DEPRECATED
36void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node)
37{
38 _cds_lfs_node_init_rcu(node);
39}
40
41static inline
42void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s)
43{
44 _cds_lfs_init_rcu(s);
45}
46
47static inline CDS_LFS_RCU_DEPRECATED
48int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
49 struct cds_lfs_node_rcu *node)
50{
51 return _cds_lfs_push_rcu(s, node);
52}
53
54static inline CDS_LFS_RCU_DEPRECATED
55struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s)
56{
57 return _cds_lfs_pop_rcu(s);
58}
59
60#else /* !_LGPL_SOURCE */
61
62extern CDS_LFS_RCU_DEPRECATED
63void cds_lfs_node_init_rcu(struct cds_lfs_node_rcu *node);
64extern CDS_LFS_RCU_DEPRECATED
65void cds_lfs_init_rcu(struct cds_lfs_stack_rcu *s);
66extern CDS_LFS_RCU_DEPRECATED
67int cds_lfs_push_rcu(struct cds_lfs_stack_rcu *s,
68 struct cds_lfs_node_rcu *node);
69
70/*
71 * Should be called under rcu read lock critical section.
72 *
73 * The caller must wait for a grace period to pass before freeing the returned
74 * node or modifying the cds_lfs_node_rcu structure.
75 * Returns NULL if stack is empty.
76 */
77extern CDS_LFS_RCU_DEPRECATED
78struct cds_lfs_node_rcu *cds_lfs_pop_rcu(struct cds_lfs_stack_rcu *s);
79
80#endif /* !_LGPL_SOURCE */
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif /* _URCU_RCULFSTACK_H */
This page took 0.024591 seconds and 5 git commands to generate.