7 * Userspace RCU QSBR header.
9 * LGPL-compatible code should include this header with :
11 * #define _LGPL_SOURCE
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public
16 * License as published by the Free Software Foundation; either
17 * version 2.1 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
28 * IBM's contributions to this file may be relicensed under LGPLv2 or later.
35 #include <urcu/config.h>
38 * See urcu/pointer.h and urcu/static/pointer.h for pointer
39 * publication headers.
41 #include <urcu/pointer.h>
42 #include <urcu/urcu-poll.h>
48 #include <urcu/map/urcu-qsbr.h>
50 #ifdef RCU_DEBUG /* For backward compatibility */
57 * Each thread containing read-side critical sections must be registered
58 * with rcu_register_thread() before calling rcu_read_lock().
59 * rcu_unregister_thread() should be called before the thread exits.
64 #include <urcu/static/urcu-qsbr.h>
67 * Mappings for static use of the userspace RCU library.
68 * Should only be used in LGPL-compatible code.
75 * Mark the beginning and end of a read-side critical section.
76 * DON'T FORGET TO USE rcu_register_thread/rcu_unregister_thread()
77 * FOR EACH THREAD WITH READ-SIDE CRITICAL SECTION.
79 #define urcu_qsbr_read_lock _urcu_qsbr_read_lock
80 #define urcu_qsbr_read_unlock _urcu_qsbr_read_unlock
81 #define urcu_qsbr_read_ongoing _urcu_qsbr_read_ongoing
83 #define urcu_qsbr_quiescent_state _urcu_qsbr_quiescent_state
84 #define urcu_qsbr_thread_offline _urcu_qsbr_thread_offline
85 #define urcu_qsbr_thread_online _urcu_qsbr_thread_online
87 #else /* !_LGPL_SOURCE */
90 * library wrappers to be used by non-LGPL compatible source code.
94 * QSBR read lock/unlock are guaranteed to be no-ops. Therefore, we expose them
95 * in the LGPL header for any code to use. However, the debug version is not
96 * nops and may contain sanity checks. To activate it, applications must be
97 * recompiled with -DDEBUG_RCU (even non-LGPL/GPL applications), or
98 * compiled against a urcu/config.h that has CONFIG_RCU_DEBUG defined.
99 * This is the best trade-off between license/performance/code
100 * triviality and library debugging & tracing features we could come up
104 #if (!defined(BUILD_QSBR_LIB) && !defined(DEBUG_RCU) && !defined(CONFIG_RCU_DEBUG))
106 static inline void urcu_qsbr_read_lock(void)
110 static inline void urcu_qsbr_read_unlock(void)
114 #else /* #if (!defined(BUILD_QSBR_LIB) && !defined(DEBUG_RCU) && !defined(CONFIG_RCU_DEBUG)) */
116 extern void urcu_qsbr_read_lock(void);
117 extern void urcu_qsbr_read_unlock(void);
119 #endif /* #else #if (!defined(BUILD_QSBR_LIB) && !defined(DEBUG_RCU) && !defined(CONFIG_RCU_DEBUG)) */
121 extern int urcu_qsbr_read_ongoing(void);
122 extern void urcu_qsbr_quiescent_state(void);
123 extern void urcu_qsbr_thread_offline(void);
124 extern void urcu_qsbr_thread_online(void);
126 #endif /* !_LGPL_SOURCE */
128 extern void urcu_qsbr_synchronize_rcu(void);
131 * RCU grace period polling API.
133 extern struct urcu_gp_poll_state
urcu_qsbr_start_poll_synchronize_rcu(void);
134 extern bool urcu_qsbr_poll_state_synchronize_rcu(struct urcu_gp_poll_state state
);
137 * Reader thread registration.
139 extern void urcu_qsbr_register_thread(void);
140 extern void urcu_qsbr_unregister_thread(void);
146 #include <urcu/call-rcu.h>
147 #include <urcu/defer.h>
148 #include <urcu/flavor.h>
151 #include <urcu/map/clear.h>
154 #endif /* _URCU_QSBR_H */
This page took 0.033679 seconds and 4 git commands to generate.