folly::transition_to_upgrade_lock

Immediately and atomically downgrades an exclusive lock to an upgrade lock.

Synopsis

Declared in <folly/synchronization/Lock.h>

template<typename Mutex>
upgrade_lock<Mutex>
transition_to_upgrade_lock(unique_lock<Mutex>& lock);

Return Value

An upgrade lock holder for the same mutex.

Parameters

NameDescription
lockThe exclusive lock holder to transition from.