std::shared_lock<folly::SharedMutexImpl<ReaderPriority, Tag_, Atom, Policy>>::shared_lock

Constructors

Synopses

Declared in <folly/SharedMutex.h>

Constructs a lock that owns no mutex.

shared_lock() noexcept = default;
» more...

Deleted copy constructor; the lock is not copyable.

shared_lock(shared_lock const& other) = delete;
» more...

Move-constructs a lock, transferring ownership from another lock.

shared_lock(shared_lock&& other) noexcept;
» more...

Constructs a lock and acquires the mutex in shared mode.

[[nodiscard]]
explicit
shared_lock(mutex_type& mutex);
» more...

Constructs a lock that adopts an already-held shared lock.

[[nodiscard]]
shared_lock(
    mutex_type& mutex,
    std::adopt_lock_t unused);
» more...

Constructs a lock that manages a mutex without acquiring it.

shared_lock(
    mutex_type& mutex,
    std::defer_lock_t unused) noexcept;
» more...

Constructs a lock and tries to acquire the mutex without blocking.

[[nodiscard]]
shared_lock(
    mutex_type& mutex,
    std::try_to_lock_t unused);
» more...

Constructs a lock and tries to acquire the mutex within a duration.

template<
    typename Rep,
    typename Period>
[[nodiscard]]
shared_lock(
    mutex_type& mutex,
    std::chrono::duration<Rep, Period> const& timeout);
» more...

Constructs a lock and tries to acquire the mutex by a deadline.

template<
    typename Clock,
    typename Duration>
[[nodiscard]]
shared_lock(
    mutex_type& mutex,
    std::chrono::time_point<Clock, Duration> const& deadline);
» more...

Parameters

NameDescription
otherThe lock that would be copied from.
mutexMutex to lock.
unusedTag selecting lock adoption.
timeoutMaximum time to wait for the lock.
deadlineAbsolute time by which the lock must be acquired.