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

Name

Description

timeout

Maximum time to wait for the lock.

Created with MrDocs