std::shared_lock specialization for folly::SharedMutexImpl.

Synopsis

Declared in <folly/SharedMutex.h>

template<
    bool ReaderPriority,
    typename Tag_,
    template<typename> typename Atom,
    typename Policy>
class shared_lock<folly::SharedMutexImpl<ReaderPriority, Tag_, Atom, Policy>>;

Description

Uses the tokenful version of unlock_shared for faster unlocking by carrying a token that records where the shared lock was taken.

Type Aliases

Name

Description

mutex_type

The mutex type this lock manages.

token_type

The token type used to record the shared lock.

Member Functions

Name

Description

shared_lock [constructor]

Constructors

~shared_lock [destructor]

Releases the shared lock if it is held.

operator=

Assignment operators

lock

Acquires the managed mutex in shared mode.

mutex

Returns the managed mutex without releasing ownership.

owns_lock

Reports whether this lock currently owns a shared lock.

release

Releases ownership of the managed mutex without unlocking it.

swap

Swaps the managed mutex and token with another lock.

try_lock

Tries to acquire the managed mutex in shared mode without blocking.

try_lock_for

Tries to acquire the managed mutex in shared mode within a duration.

try_lock_until

Tries to acquire the managed mutex in shared mode by a deadline.

unlock

Releases the managed shared lock.

operator bool

Reports whether this lock currently owns a shared lock.

Template Parameters

Name

Description

ReaderPriority

Whether the mutex gives priority to readers.

Tag_

Tag type of the mutex instantiation.

Atom

Atomic template used by the mutex.

Policy

Policy type of the mutex.

Created with MrDocs