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

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

Synopsis

Declared in <folly/SharedMutex.h>

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

Return Value

NOTE

The return value should not be discarded.

Parameters

NameDescription
mutexMutex to try to lock.
timeoutMaximum time to wait for the lock.