From: Mathieu Desnoyers Date: Sun, 11 Sep 2011 05:02:58 +0000 (-0700) Subject: call_rcu: register work threads as rcu readers X-Git-Tag: v0.6.5~26 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=765f3eadad5647e6fa853414fc652670f9e00966;p=urcu.git call_rcu: register work threads as rcu readers Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu-bp.h b/urcu-bp.h index 09ee9c9..451bedb 100644 --- a/urcu-bp.h +++ b/urcu-bp.h @@ -114,6 +114,21 @@ static inline void rcu_init(void) { } +/* + * Q.S. reporting are no-ops for these URCU flavors. + */ +static inline void rcu_quiescent_state(void) +{ +} + +static inline void rcu_thread_offline(void) +{ +} + +static inline void rcu_thread_online(void) +{ +} + #ifdef __cplusplus } #endif diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index b9e57cd..38cc001 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -215,6 +215,11 @@ static void *call_rcu_thread(void *arg) exit(-1); } + /* + * If callbacks take a read-side lock, we need to be registered. + */ + rcu_register_thread(); + thread_call_rcu_data = crdp; if (!rt) { uatomic_dec(&crdp->futex); @@ -247,6 +252,7 @@ static void *call_rcu_thread(void *arg) } if (uatomic_read(&crdp->flags) & URCU_CALL_RCU_STOP) break; + rcu_thread_offline(); if (!rt) { if (&crdp->cbs.head == _CMM_LOAD_SHARED(crdp->cbs.tail)) { @@ -264,6 +270,7 @@ static void *call_rcu_thread(void *arg) } else { poll(NULL, 0, 10); } + rcu_thread_online(); } if (!rt) { /* @@ -273,6 +280,7 @@ static void *call_rcu_thread(void *arg) uatomic_set(&crdp->futex, 0); } uatomic_or(&crdp->flags, URCU_CALL_RCU_STOPPED); + rcu_unregister_thread(); return NULL; } diff --git a/urcu.h b/urcu.h index 5728c07..1ad971c 100644 --- a/urcu.h +++ b/urcu.h @@ -107,6 +107,21 @@ extern void rcu_unregister_thread(void); */ extern void rcu_init(void); +/* + * Q.S. reporting are no-ops for these URCU flavors. + */ +static inline void rcu_quiescent_state(void) +{ +} + +static inline void rcu_thread_offline(void) +{ +} + +static inline void rcu_thread_online(void) +{ +} + #ifdef __cplusplus } #endif