Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXCondition Class Reference

A condition allows one or more threads to synchronize to an event. More...

#include <FXCondition.h>

Public Member Functions

 FXCondition ()
 Initialize the condition.
 
void signal ()
 Wake or unblock a single blocked thread.
 
void broadcast ()
 Wake or unblock all blocked threads.
 
FXbool wait (FXMutex &mtx)
 Wait until condition becomes signalled, using given mutex, which must already have been locked prior to this call. More...
 
FXbool wait (FXScopedMutex &smx)
 
FXbool wait (FXReverseMutex &rmx)
 
FXbool wait (FXMutex &mtx, FXTime nsec)
 Wait until condition becomes signalled, using given mutex, which must already have been locked prior to this call. More...
 
FXbool wait (FXScopedMutex &smx, FXTime nsec)
 
FXbool wait (FXReverseMutex &rmx, FXTime nsec)
 
 ~FXCondition ()
 Delete the condition.
 

Detailed Description

A condition allows one or more threads to synchronize to an event.

When a thread calls wait, the associated mutex is unlocked while the thread is blocked. When the condition becomes signaled, the associated mutex is locked and the thread(s) are reawakened.

Member Function Documentation

◆ wait() [1/2]

FXbool FX::FXCondition::wait ( FXMutex mtx)

Wait until condition becomes signalled, using given mutex, which must already have been locked prior to this call.

Return true if the wait ended due to the condition being signalled through signal() or broadcast(), and false if the wait was interrupted or some error occurred.

◆ wait() [2/2]

FXbool FX::FXCondition::wait ( FXMutex mtx,
FXTime  nsec 
)

Wait until condition becomes signalled, using given mutex, which must already have been locked prior to this call.

Return true if the wait ended due to the condition being signalled through signal() or broadcast(), and false if the wait timed out, was interrupted, or some other error occurred. The relative timeout nsec is specified in nanoseconds; if the special value 'forever' is passed, wait indefinitely.


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

Copyright © 1997-2022 Jeroen van der Zijp