Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::Sync< T, AsyncMutex >::Lock Class Reference
Inheritance diagram for nix::Sync< T, AsyncMutex >::Lock:

Public Member Functions

 Lock (Lock &&)=default
Lock & operator= (Lock &&)=default
kj::Promise< void > wait ()
T * operator-> ()
T & operator* ()
std::cv_status wait_for (std::condition_variable &cv, const std::chrono::duration< Rep, Period > &duration)
std::cv_status wait_until (std::condition_variable &cv, const std::chrono::time_point< Clock, Duration > &duration)

Protected Member Functions

void checkLockingInvariants ()

Protected Attributes

Sync * s
std::unique_lock< AsyncMutex > lk

Member Function Documentation

◆ wait()

template<class T>
kj::Promise< void > nix::Sync< T, AsyncMutex >::Lock::wait ( )
inline

Releases the lock, waits for another promise to call Sync::notify, and reacquires the lock. There is no condition_variable-equivalent object to allow multiple wait queues on the same lock since we don't need that yet. There's no reason not to add such a type when needed.

◆ wait_for()

std::cv_status nix::Sync< T, AsyncMutex >::Lock::wait_for ( std::condition_variable & cv,
const std::chrono::duration< Rep, Period > & duration )
inline

Wait for the given condition variable for a maximum elapsed time of duration.

May spuriously wake up.

◆ wait_until()

std::cv_status nix::Sync< T, AsyncMutex >::Lock::wait_until ( std::condition_variable & cv,
const std::chrono::time_point< Clock, Duration > & duration )
inline

Wait for the given condition variable or until the time point duration.


The documentation for this class was generated from the following file: