}
thread_call_rcu_data = crdp;
+ if (!rt) {
+ uatomic_dec(&crdp->futex);
+ /* Decrement futex before reading call_rcu list */
+ cmm_smp_mb();
+ }
for (;;) {
- if (!rt) {
- uatomic_dec(&crdp->futex);
- /* Decrement futex before reading call_rcu list */
- cmm_smp_mb();
- }
if (&crdp->cbs.head != _CMM_LOAD_SHARED(crdp->cbs.tail)) {
while ((cbs = _CMM_LOAD_SHARED(crdp->cbs.head)) == NULL)
poll(NULL, 0, 1);
} while (cbs != NULL);
uatomic_sub(&crdp->qlen, cbcount);
}
- if (uatomic_read(&crdp->flags) & URCU_CALL_RCU_STOP) {
- if (!rt) {
+ if (uatomic_read(&crdp->flags) & URCU_CALL_RCU_STOP)
+ break;
+ if (!rt) {
+ if (&crdp->cbs.head
+ == _CMM_LOAD_SHARED(crdp->cbs.tail)) {
+ call_rcu_wait(crdp);
+ poll(NULL, 0, 10);
+ uatomic_dec(&crdp->futex);
/*
- * Read call_rcu list before write futex.
+ * Decrement futex before reading
+ * call_rcu list.
*/
cmm_smp_mb();
- uatomic_set(&crdp->futex, 0);
}
- break;
- }
- if (!rt) {
- if (&crdp->cbs.head == _CMM_LOAD_SHARED(crdp->cbs.tail))
- call_rcu_wait(crdp);
+ } else {
+ poll(NULL, 0, 10);
}
- poll(NULL, 0, 10);
+ }
+ if (!rt) {
+ /*
+ * Read call_rcu list before write futex.
+ */
+ cmm_smp_mb();
+ uatomic_set(&crdp->futex, 0);
}
uatomic_or(&crdp->flags, URCU_CALL_RCU_STOPPED);
return NULL;