folly::try_transition_to_unique_lock_until

try_transition_to_unique_lock_until overloads

Synopses

Declared in <folly/synchronization/Lock.h>

Attempts, up to a deadline, to atomically upgrade a shared lock to an exclusive lock.

template<
    typename Mutex,
    typename Clock,
    typename Duration>
unique_lock<Mutex>
try_transition_to_unique_lock_until(
    shared_lock<Mutex>& lock,
    std::chrono::time_point<Clock, Duration> const& deadline);
» more...

Attempts, up to a deadline, to atomically upgrade an upgrade lock to an exclusive lock.

template<
    typename Mutex,
    typename Clock,
    typename Duration>
unique_lock<Mutex>
try_transition_to_unique_lock_until(
    upgrade_lock<Mutex>& lock,
    std::chrono::time_point<Clock, Duration> const& deadline);
» more...

Return Value

An exclusive lock holder; empty if the attempt failed.

Parameters

NameDescription
lockThe shared lock holder to transition from.
deadlineThe time point past which to stop waiting.