Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
|
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. | |
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.
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.
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.
Copyright © 1997-2022 Jeroen van der Zijp |