Constructs a lock and tries to acquire the mutex by a deadline.

Synopsis

Declared in <folly/SharedMutex.h>

template<
    typename Clock,
    typename Duration>
[[nodiscard]]
shared_lock(
    mutex_type& mutex,
    std::chrono::time_point<Clock, Duration> const& deadline);

Return Value

Note

The return value should not be discarded.

Parameters

Name

Description

mutex

Mutex to try to lock.

deadline

Absolute time by which the lock must be acquired.

Created with MrDocs