summaryrefslogtreecommitdiff
path: root/lib/rcu.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rcu.h')
-rw-r--r--lib/rcu.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/rcu.h b/lib/rcu.h
index ac8fc9ce..30eacc5b 100644
--- a/lib/rcu.h
+++ b/lib/rcu.h
@@ -21,33 +21,33 @@
extern _Atomic uint rcu_gp_ctl;
-struct rcu_coro {
+struct rcu_thread {
node n;
_Atomic uint ctl;
};
-extern _Thread_local struct rcu_coro *this_rcu_coro;
+extern _Thread_local struct rcu_thread *this_rcu_thread;
static inline void rcu_read_lock(void)
{
- uint cmp = atomic_load_explicit(&this_rcu_coro->ctl, memory_order_acquire);
+ uint cmp = atomic_load_explicit(&this_rcu_thread->ctl, memory_order_acquire);
if (cmp & RCU_NEST_MASK)
- atomic_store_explicit(&this_rcu_coro->ctl, cmp + RCU_NEST_CNT, memory_order_relaxed);
+ atomic_store_explicit(&this_rcu_thread->ctl, cmp + RCU_NEST_CNT, memory_order_relaxed);
else
- atomic_store(&this_rcu_coro->ctl, atomic_load_explicit(&rcu_gp_ctl, memory_order_acquire));
+ atomic_store(&this_rcu_thread->ctl, atomic_load_explicit(&rcu_gp_ctl, memory_order_acquire));
}
static inline void rcu_read_unlock(void)
{
- atomic_fetch_sub(&this_rcu_coro->ctl, RCU_NEST_CNT);
+ atomic_fetch_sub(&this_rcu_thread->ctl, RCU_NEST_CNT);
}
void synchronize_rcu(void);
-/* Registering and unregistering a coroutine. To be called from coroutine implementation */
-void rcu_coro_start(struct rcu_coro *);
-void rcu_coro_stop(struct rcu_coro *);
+/* Registering and unregistering a birdloop. To be called from birdloop implementation */
+void rcu_thread_start(struct rcu_thread *);
+void rcu_thread_stop(struct rcu_thread *);
/* Run this from resource init */
void rcu_init(void);