Waits for all pre‐existing RCU readers in the domain to complete.

Synopsis

Declared in <folly/synchronization/Rcu.h>

void
rcu_synchronize(rcu_domain& domain = rcu_default_domain()) noexcept;

Description

Waits for all pre‐existing RCU readers to complete. RCU readers will normally be marked using the RAII interface std::scoped_lock<folly::rcu_domain>, as in:

std::scoped_lock<folly::rcu_domain> rcuReader(rcu_default_domain());

Other locking primitives that provide moveable semantics such as std::unique_lock may be used as well.

Note that rcu_synchronize is not obligated to wait for RCU readers that start after rcu_synchronize starts. Note also that holding a lock across rcu_synchronize that is acquired by any deleter (as in is passed to rcu_retire, retire, or call) will result in deadlock. Note that such deadlock will normally only occur with user‐written deleters, as in the default of delete will normally be immune to such deadlocks.

Parameters

Name

Description

domain

The domain to synchronize; defaults to the default domain.

Created with MrDocs