folly::try_transition_to_upgrade_lock_until

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

Synopsis

Declared in <folly/synchronization/Lock.h>

template<
    typename Mutex,
    typename Clock,
    typename Duration>
upgrade_lock<Mutex>
try_transition_to_upgrade_lock_until(
    shared_lock<Mutex>& lock,
    std::chrono::time_point<Clock, Duration> const& deadline);

Return Value

An upgrade lock holder; empty if the attempt failed.

Parameters

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