2 * SPDX-License-Identifier: LGPL-2.1-or-later
4 * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
7 * Userspace RCU header for LTTng-UST. Derived from liburcu
8 * "bulletproof" flavor.
10 * Slower RCU read-side adapted for tracing library. Does not require thread
11 * registration nor unregistration. Also signal-safe.
13 * LGPL-compatible code should include this header with :
15 * #define _LGPL_SOURCE
16 * #include <lttng/urcu-ust.h>
19 #ifndef _LTTNG_UST_URCU_H
20 #define _LTTNG_UST_URCU_H
30 * See lttng/urcu/pointer.h and lttng/urcu/static/pointer.h for pointer
31 * publication headers.
33 #include <lttng/urcu/pointer.h>
37 #include <lttng/urcu/static/urcu-ust.h>
40 * Mappings for static use of the userspace RCU library.
41 * Should only be used in LGPL-compatible code.
45 * lttng_ust_urcu_read_lock()
46 * lttng_ust_urcu_read_unlock()
48 * Mark the beginning and end of a read-side critical section.
50 #define lttng_ust_urcu_read_lock _lttng_ust_urcu_read_lock
51 #define lttng_ust_urcu_read_unlock _lttng_ust_urcu_read_unlock
52 #define lttng_ust_urcu_read_ongoing _lttng_ust_urcu_read_ongoing
54 #else /* !_LGPL_SOURCE */
57 * library wrappers to be used by non-LGPL compatible source code.
58 * See LGPL-only urcu/static/pointer.h for documentation.
61 extern void lttng_ust_urcu_read_lock(void);
62 extern void lttng_ust_urcu_read_unlock(void);
63 extern int lttng_ust_urcu_read_ongoing(void);
65 #endif /* !_LGPL_SOURCE */
67 extern void lttng_ust_urcu_synchronize_rcu(void);
70 * lttng_ust_urcu_before_fork, lttng_ust_urcu_after_fork_parent and
71 * lttng_ust_urcu_after_fork_child should be called around fork() system
72 * calls when the child process is not expected to immediately perform
73 * an exec(). For pthread users, see pthread_atfork(3).
75 extern void lttng_ust_urcu_before_fork(void);
76 extern void lttng_ust_urcu_after_fork_parent(void);
77 extern void lttng_ust_urcu_after_fork_child(void);
80 * In the UST version, thread registration is performed lazily, but it can be
81 * forced by issuing an explicit lttng_ust_urcu_register_thread().
83 extern void lttng_ust_urcu_register_thread(void);
89 #endif /* _LTTNG_UST_URCU_H */
This page took 0.048661 seconds and 4 git commands to generate.