ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
original::condition Class Referencefinal
Inheritance diagram for original::condition:
Inheritance graph
Collaboration diagram for original::condition:
Collaboration graph

Public Member Functions

void wait (mutexBase &mutex) override
 Waits for notification while holding the mutex.
 
bool waitFor (mutexBase &mutex, time::duration d) override
 Waits for notification with timeout.
 
void notify () override
 Notifies one waiting thread.
 
void notifyAll () override
 Notifies all waiting threads.
 
virtual void wait (mutexBase &mutex)=0
 Waits for notification while holding the mutex.
 
template<typename Pred >
void wait (mutexBase &mutex, Pred predicate) noexcept(noexcept(predicate()))
 Waits until predicate becomes true.
 
virtual bool waitFor (mutexBase &mutex, time::duration d)=0
 Waits for notification with timeout.
 
template<typename Pred >
bool waitFor (mutexBase &mutex, const time::duration &d, Pred predicate) noexcept(noexcept(predicate()))
 Waits with timeout until predicate becomes true.
 
- Public Member Functions inherited from original::conditionBase
 conditionBase ()=default
 Default constructor.
 
template<typename Pred >
void wait (mutexBase &mutex, Pred predicate) noexcept(noexcept(predicate()))
 Waits until predicate becomes true.
 
template<typename Pred >
bool waitFor (mutexBase &mutex, const time::duration &d, Pred predicate) noexcept(noexcept(predicate()))
 Waits with timeout until predicate becomes true.
 
void notifySome (u_integer n)
 Notifies a specified number of waiting threads.
 
virtual ~conditionBase ()=default
 Virtual destructor.
 
 conditionBase (const conditionBase &)=delete
 Deleted copy constructor.
 
conditionBaseoperator= (const conditionBase &)=delete
 Deleted copy assignment operator.
 

Member Function Documentation

◆ notify()

void original::condition::notify ( )
inlineoverridevirtual

Notifies one waiting thread.

Exceptions
sysErrorif notification fails

Implements original::conditionBase.

◆ notifyAll()

void original::condition::notifyAll ( )
inlineoverridevirtual

Notifies all waiting threads.

Exceptions
sysErrorif notification fails

Implements original::conditionBase.

◆ wait() [1/3]

void original::condition::wait ( mutexBase mutex)
inlineoverridevirtual

Waits for notification while holding the mutex.

Parameters
mutexLocked mutex to wait on
Exceptions
sysErrorif wait operation fails
Note
The mutex must be locked by the calling thread

Implements original::conditionBase.

◆ wait() [2/3]

virtual void original::conditionBase::wait ( mutexBase mutex)
virtual

Waits for notification while holding the mutex.

Parameters
mutexLocked mutex to wait on
Exceptions
sysErrorif wait operation fails
Note
The mutex must be locked by the calling thread

Implements original::conditionBase.

◆ wait() [3/3]

template<typename Pred >
void original::conditionBase::wait ( mutexBase mutex,
Pred  predicate 
)
noexcept

Waits until predicate becomes true.

Template Parameters
PredPredicate type (must be callable and return bool)
Parameters
mutexLocked mutex to wait on
predicateCondition predicate to check
Exceptions
sysErrorif wait operation fails
Note
Implements the "wait with predicate" pattern to avoid spurious wakeups

◆ waitFor() [1/3]

template<typename Pred >
bool original::conditionBase::waitFor ( mutexBase mutex,
const time::duration d,
Pred  predicate 
)
noexcept

Waits with timeout until predicate becomes true.

Template Parameters
PredPredicate type (must be callable and return bool)
Parameters
mutexLocked mutex to wait on
dMaximum duration to wait
predicateCondition predicate to check
Returns
true if predicate became true, false if timeout occurred
Exceptions
sysErrorif wait operation fails

◆ waitFor() [2/3]

bool original::condition::waitFor ( mutexBase mutex,
time::duration  d 
)
inlineoverridevirtual

Waits for notification with timeout.

Parameters
mutexLocked mutex to wait on
dMaximum duration to wait
Returns
true if notified, false if timeout occurred
Exceptions
sysErrorif wait operation fails
Note
The mutex must be locked by the calling thread

Implements original::conditionBase.

◆ waitFor() [3/3]

virtual bool original::conditionBase::waitFor ( mutexBase mutex,
time::duration  d 
)
virtual

Waits for notification with timeout.

Parameters
mutexLocked mutex to wait on
dMaximum duration to wait
Returns
true if notified, false if timeout occurred
Exceptions
sysErrorif wait operation fails
Note
The mutex must be locked by the calling thread

Implements original::conditionBase.


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