folly::transition_lock

Atomically transitions from the from-lock to the to-lock, waiting unboundedly for the transition to become available.

Synopsis

Declared in <folly/synchronization/Lock.h>

template<
    template<typename> typename ToLock,
    typename Mutex,
    template<typename> typename FromLock>
ToLock<Mutex>
transition_lock(FromLock<Mutex>& lock);

Return Value

A lock holder of the target lock type.

Parameters

NameDescription
lockThe lock holder to transition from.