folly::hybrid_lock

A lock-holder type which holds shared locks for shared mutex types or exclusive locks otherwise.

Synopsis

Declared in <folly/synchronization/Lock.h>

template<typename Mutex>
class hybrid_lock
    : public hybrid_lock_base<Mutex>

Base Classes

NameDescription
hybrid_lock_base<Mutex>A lock-holder base which holds shared locks for shared mutex types or exclusive locks otherwise.

Member Functions

NameDescription
swap Swaps the held lock state with another lock holder.

Using Declarations

Name
Unnamed using

Deduction Guides

NameDescription
hybrid_lock<Mutex> Deduces the mutex type of a hybrid_lock from its constructor arguments.

Non-Member Functions

NameDescription
swapSwaps the held lock state of two lock holders.