Constructors
Declared in <folly/SharedMutex.h>
Constructs a lock that owns no mutex.
shared_lock() noexcept = default;
» more...
Deleted copy constructor; the lock is not copyable.
shared_lock(shared_lock const& other) = delete;
» more...
Move-constructs a lock, transferring ownership from another lock.
shared_lock(shared_lock&& other) noexcept;
» more...
Constructs a lock and acquires the mutex in shared mode.
[[nodiscard]]
explicit
shared_lock(mutex_type& mutex);
» more...
Constructs a lock that adopts an already-held shared lock.
[[nodiscard]]
shared_lock(
mutex_type& mutex,
std::adopt_lock_t unused);
» more...
Constructs a lock that manages a mutex without acquiring it.
shared_lock(
mutex_type& mutex,
std::defer_lock_t unused) noexcept;
» more...
Constructs a lock and tries to acquire the mutex without blocking.
[[nodiscard]]
shared_lock(
mutex_type& mutex,
std::try_to_lock_t unused);
» more...
Constructs a lock and tries to acquire the mutex within a duration.
template<
typename Rep,
typename Period>
[[nodiscard]]
shared_lock(
mutex_type& mutex,
std::chrono::duration<Rep, Period> const& timeout);
» more...
Constructs a lock and tries to acquire the mutex by a deadline.
template<
typename Clock,
typename Duration>
[[nodiscard]]
shared_lock(
mutex_type& mutex,
std::chrono::time_point<Clock, Duration> const& deadline);
» more...
| Name | Description |
|---|---|
| other | The lock that would be copied from. |
| mutex | Mutex to lock. |
| unused | Tag selecting lock adoption. |
| timeout | Maximum time to wait for the lock. |
| deadline | Absolute time by which the lock must be acquired. |