uatomic: fix i386 support
[urcu.git] / urcu-call-rcu.h
CommitLineData
b57aee66
PM
1#ifndef _URCU_CALL_RCU_H
2#define _URCU_CALL_RCU_H
3
4/*
5 * urcu-call-rcu.h
6 *
7 * Userspace RCU header - deferred execution
8 *
9 * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
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#include <urcu/wfqueue.h>
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41/* Note that struct call_rcu_data is opaque to callers. */
42
43struct call_rcu_data;
44
45/* Flag values. */
46
47#define URCU_CALL_RCU_RT 0x1
48#define URCU_CALL_RCU_RUNNING 0x2
7106ddf8
PM
49#define URCU_CALL_RCU_STOP 0x4
50#define URCU_CALL_RCU_STOPPED 0x8
b57aee66
PM
51
52/*
53 * The rcu_head data structure is placed in the structure to be freed
54 * via call_rcu().
55 */
56
57struct rcu_head {
58 struct cds_wfq_node next;
59 void (*func)(struct rcu_head *head);
60};
61
62/*
63 * Exported functions
64 */
b57aee66
PM
65struct call_rcu_data *get_cpu_call_rcu_data(int cpu);
66pthread_t get_call_rcu_thread(struct call_rcu_data *crdp);
c1d2c60b
MD
67struct call_rcu_data *create_call_rcu_data(unsigned long flags,
68 int cpu_affinity);
b57aee66
PM
69int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp);
70struct call_rcu_data *get_default_call_rcu_data(void);
71struct call_rcu_data *get_call_rcu_data(void);
72struct call_rcu_data *get_thread_call_rcu_data(void);
73void set_thread_call_rcu_data(struct call_rcu_data *crdp);
74int create_all_cpu_call_rcu_data(unsigned long flags);
75void call_rcu(struct rcu_head *head,
76 void (*func)(struct rcu_head *head));
7106ddf8
PM
77void call_rcu_data_free(struct call_rcu_data *crdp);
78void free_all_cpu_call_rcu_data(void);
79void call_rcu_after_fork_child(void);
b57aee66
PM
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif /* _URCU_CALL_RCU_H */
This page took 0.02545 seconds and 4 git commands to generate.