urcu/compiler: Add urcu_static_assert
[urcu.git] / include / urcu / defer.h
CommitLineData
d3d3857f
MJ
1// SPDX-FileCopyrightText: 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
2// SPDX-FileCopyrightText: 2009 Paul E. McKenney, IBM Corporation.
3//
4// SPDX-License-Identifier: LGPL-2.1-or-later
5
89d19b43
MD
6#ifndef _URCU_DEFER_H
7#define _URCU_DEFER_H
90075a50
MD
8
9/*
786ee85b 10 * Userspace RCU header - deferred execution
90075a50 11 *
89d19b43
MD
12 * This header is meant to be included indirectly through a liburcu
13 * flavor header.
90075a50
MD
14 */
15
16#include <stdlib.h>
17#include <pthread.h>
18
36bc70a8
MD
19#ifdef __cplusplus
20extern "C" {
21#endif
22
90075a50 23/*
3614f13c
MD
24 * Note: the defer_rcu() API is currently EXPERIMENTAL. It may change in the
25 * future.
67ecffc0 26 *
90075a50
MD
27 * Important !
28 *
29 * Each thread queuing memory reclamation must be registered with
786ee85b 30 * rcu_defer_register_thread(). rcu_defer_unregister_thread() should be
90075a50 31 * called before the thread exits.
8a13058c 32 *
b4f313b7
MD
33 * *NEVER* use defer_rcu() within a RCU read-side critical section, because this
34 * primitive need to call synchronize_rcu() if the thread queue is full.
90075a50
MD
35 */
36
3614f13c 37extern void defer_rcu(void (*fct)(void *p), void *p);
2c22932b 38
90075a50
MD
39/*
40 * Thread registration for reclamation.
41 */
7fdbbd61 42extern int rcu_defer_register_thread(void);
786ee85b
MD
43extern void rcu_defer_unregister_thread(void);
44extern void rcu_defer_barrier(void);
45extern void rcu_defer_barrier_thread(void);
90075a50 46
67ecffc0 47#ifdef __cplusplus
36bc70a8
MD
48}
49#endif
50
89d19b43 51#endif /* _URCU_DEFER_H */
This page took 0.049036 seconds and 4 git commands to generate.