projects
/
urcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
init maxcpus before use
[urcu.git]
/
urcu-call-rcu-impl.h
diff --git
a/urcu-call-rcu-impl.h
b/urcu-call-rcu-impl.h
index 38cc00190f018cf1afd7fac07e42bcedec484af3..e0a8fd883ee4a24782b3464a970f20be645b5fdc 100644
(file)
--- a/
urcu-call-rcu-impl.h
+++ b/
urcu-call-rcu-impl.h
@@
-383,9
+383,10
@@
struct call_rcu_data *create_call_rcu_data(unsigned long flags,
int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp)
{
int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp)
{
- int warned = 0;
+
static
int warned = 0;
call_rcu_lock(&call_rcu_mutex);
call_rcu_lock(&call_rcu_mutex);
+ alloc_cpu_call_rcu_data();
if (cpu < 0 || maxcpus <= cpu) {
if (!warned) {
fprintf(stderr, "[error] liburcu: set CPU # out of range\n");
if (cpu < 0 || maxcpus <= cpu) {
if (!warned) {
fprintf(stderr, "[error] liburcu: set CPU # out of range\n");
@@
-395,7
+396,6
@@
int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp)
errno = EINVAL;
return -EINVAL;
}
errno = EINVAL;
return -EINVAL;
}
- alloc_cpu_call_rcu_data();
call_rcu_unlock(&call_rcu_mutex);
if (per_cpu_call_rcu_data == NULL) {
errno = ENOMEM;
call_rcu_unlock(&call_rcu_mutex);
if (per_cpu_call_rcu_data == NULL) {
errno = ENOMEM;
@@
-482,7
+482,9
@@
void set_thread_call_rcu_data(struct call_rcu_data *crdp)
/*
* Create a separate call_rcu thread for each CPU. This does not
* replace a pre-existing call_rcu thread -- use the set_cpu_call_rcu_data()
/*
* Create a separate call_rcu thread for each CPU. This does not
* replace a pre-existing call_rcu thread -- use the set_cpu_call_rcu_data()
- * function if you want that behavior.
+ * function if you want that behavior. Should be paired with
+ * free_all_cpu_call_rcu_data() to teardown these call_rcu worker
+ * threads.
*/
int create_all_cpu_call_rcu_data(unsigned long flags)
*/
int create_all_cpu_call_rcu_data(unsigned long flags)
This page took
0.024386 seconds
and
4
git commands to generate.