Tries to acquire the lock in exclusive mode within a duration.
Declared in <folly/SharedMutex.h>
template<
class Rep,
class Period>
bool
try_lock_for(std::chrono::duration<Rep, Period> const& duration);
true if the lock was acquired before the duration elapsed.
| Name | Description |
|---|---|
| duration | Maximum time to wait for the lock. |