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

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

Synopsis

Declared in <folly/SharedMutex.h>

template<
    typename Rep,
    typename Period>
bool
try_lock_for(std::chrono::duration<Rep, Period> const& timeout);

Return Value

true if the lock was acquired before the duration elapsed.

Parameters

NameDescription
timeoutMaximum time to wait for the lock.