X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=urcu-call-rcu-impl.h;h=51ee91ffd1ef87e0e8a8e76ff00b64d6dd24c660;hb=ed42f6768d2116c47ca9ef2c17927a45f6b98f04;hp=04f7798c3f57a433a3756f267e0ffdc07e5e4552;hpb=254ebaf34ca0a7c18da1efbc561a1985d815b2d1;p=userspace-rcu.git diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index 04f7798..51ee91f 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -267,6 +267,8 @@ static void *call_rcu_thread(void *arg) uatomic_or(&crdp->flags, URCU_CALL_RCU_PAUSED); while ((uatomic_read(&crdp->flags) & URCU_CALL_RCU_PAUSE) != 0) poll(NULL, 0, 1); + uatomic_and(&crdp->flags, ~URCU_CALL_RCU_PAUSED); + cmm_smp_mb__after_uatomic_and(); rcu_register_thread(); } @@ -620,12 +622,12 @@ void call_rcu(struct rcu_head *head, cds_wfq_node_init(&head->next); head->func = func; /* Holding rcu read-side lock across use of per-cpu crdp */ - rcu_read_lock(); + _rcu_read_lock(); crdp = get_call_rcu_data(); cds_wfq_enqueue(&crdp->cbs, &head->next); uatomic_inc(&crdp->qlen); wake_call_rcu_thread(crdp); - rcu_read_unlock(); + _rcu_read_unlock(); } /* @@ -763,6 +765,10 @@ void call_rcu_after_fork_parent(void) cds_list_for_each_entry(crdp, &call_rcu_data_list, list) uatomic_and(&crdp->flags, ~URCU_CALL_RCU_PAUSE); + cds_list_for_each_entry(crdp, &call_rcu_data_list, list) { + while ((uatomic_read(&crdp->flags) & URCU_CALL_RCU_PAUSED) != 0) + poll(NULL, 0, 1); + } call_rcu_unlock(&call_rcu_mutex); }