Constructs a lock and tries to acquire the mutex within a duration.
Declared in <folly/SharedMutex.h>
template<
typename Rep,
typename Period>
[[nodiscard]]
shared_lock(
mutex_type& mutex,
std::chrono::duration<Rep, Period> const& timeout);
The return value should not be discarded.
| Name | Description |
|---|---|
| mutex | Mutex to try to lock. |
| timeout | Maximum time to wait for the lock. |