FX::QWaitCondition Class Reference

#include <QThread.h>

List of all members.


Detailed Description

An OS/2 style event object (Qt compatible).

This wait condition object functions very similarly to an event object in OS/2 or Win32. Essentially, this type of object acts like a soft drink dispenser - it holds the cans (threads) in a FIFO stack from which inseting a coin (wakeOne()) takes the bottom one out and dispenses it. You can also dispense all the cans at once (wakeAll()) which permits any new cans entered in the top to be dispensed straight away until reset() is called.

To use OS/2 speak, this object is signalled when it permits any thread trying to wait on to continue straight away. This continues until the object is reset to unsignalled, whereupon any waits will halt either indefinitely or the timeout period specified.

Unlike OS/2 or Win32, you are not guaranteed that the first thread to wait on the object will be the first thread released with wakeOne(). Due to POSIX limitations, the actual thread released will be random.

Note:
On all platforms QWaitCondition will cancel the thread during a wait if a cancellation has been requested. Please consult the documentation for QThread.
Warning:
POSIX does not guarantee that POSIX wait conditions can be used from cleanup/signal handlers (most annoyingly). Indeed FreeBSD aborts the process if you try which is even more serious, so QWaitCondition::wait() issues a warning on all platforms in debug mode.

Definition at line 385 of file QThread.h.

Public Member Functions

 QWaitCondition (bool autoreset=false, bool initialstate=false)
 ~QWaitCondition ()
bool wait (FXuint time=FXINFINITE)
void wakeOne ()
void wakeAll ()
void reset ()
bool signalled () const


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:45 2009 for TnFOX by doxygen v1.4.7