protect writing to per_cpu_call_rcu_data[*]
[userspace-rcu.git] / urcu-call-rcu-impl.h
index 1ab49bc69da4eb753b264f90f5393cd22ce0fe98..c822646e03834bbf26224feae2a71bcdfb5bf8e1 100644 (file)
@@ -396,12 +396,13 @@ int set_cpu_call_rcu_data(int cpu, struct call_rcu_data *crdp)
                errno = EINVAL;
                return -EINVAL;
        }
-       call_rcu_unlock(&call_rcu_mutex);
        if (per_cpu_call_rcu_data == NULL) {
+               call_rcu_unlock(&call_rcu_mutex);
                errno = ENOMEM;
                return -ENOMEM;
        }
        per_cpu_call_rcu_data[cpu] = crdp;
+       call_rcu_unlock(&call_rcu_mutex);
        return 0;
 }
 
@@ -600,6 +601,7 @@ void call_rcu_data_free(struct call_rcu_data *crdp)
                *cbs_endprev = cbs;
                uatomic_add(&default_call_rcu_data->qlen,
                            uatomic_read(&crdp->qlen));
+               wake_call_rcu_thread(default_call_rcu_data);
        }
 
        cds_list_del(&crdp->list);
This page took 0.023074 seconds and 4 git commands to generate.