5f7498756649c6474d2b884a9992a3e0501305ae
[urcu.git] / urcu-defer.h
1 #ifndef _URCU_BATCH_H
2 #define _URCU_BATCH_H
3
4 /*
5 * urcu-defer.h
6 *
7 * Userspace RCU header - deferred execution
8 *
9 * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
10 * Copyright (c) 2009 Paul E. McKenney, IBM Corporation.
11 *
12 * LGPL-compatible code should include this header with :
13 *
14 * #define _LGPL_SOURCE
15 * #include <urcu-defer.h>
16 *
17 * This library is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 2.1 of the License, or (at your option) any later version.
21 *
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with this library; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 */
31
32 #include <stdlib.h>
33 #include <pthread.h>
34
35 /*
36 * Note: the defer_rcu() API is currently EXPERIMENTAL. It may change in the
37 * future.
38 *
39 * Important !
40 *
41 * Each thread queuing memory reclamation must be registered with
42 * rcu_defer_register_thread(). rcu_defer_unregister_thread() should be
43 * called before the thread exits.
44 *
45 * *NEVER* use defer_rcu() within a RCU read-side critical section, because this
46 * primitive need to call synchronize_rcu() if the thread queue is full.
47 */
48
49 extern void defer_rcu(void (*fct)(void *p), void *p);
50
51 /*
52 * Thread registration for reclamation.
53 */
54 extern void rcu_defer_register_thread(void);
55 extern void rcu_defer_unregister_thread(void);
56 extern void rcu_defer_barrier(void);
57 extern void rcu_defer_barrier_thread(void);
58
59 #endif /* _URCU_BATCH_H */
This page took 0.030243 seconds and 3 git commands to generate.