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

Synopsis

Declared in <folly/synchronization/Lock.h>

template<
    typename Mutex,
    typename Rep,
    typename Period>
upgrade_lock<Mutex>
try_transition_to_upgrade_lock_for(
    shared_lock<Mutex>& lock,
    std::chrono::duration<Rep, Period> const& timeout);

Return Value

An upgrade lock holder; empty if the attempt failed.

Parameters

Name

Description

lock

The shared lock holder to transition from.

timeout

The maximum duration to wait for.

Created with MrDocs