#include <syncthrd.h>
This may be used to send signals to a thread and await an acknowldegement that the signal was processed. This can be be used to initate an action in another thread and wait for the action to be completed. {verbatim} ... thread one while (condition) { sync.Wait(); do_something(); sync.Acknowledge(); }
... thread 2 do_something_else(); sync.Signal(); // At this point thread 1 wake up and does something. do_yet_more(); // However, this does not get done until Acknowldege() is called in the other thread.
{verbatim}
Definition at line 110 of file syncthrd.h.
Comparison functions | |
virtual Comparison | Compare (const PObject &obj) const |
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const |
bool | operator!= (const PObject &obj) const |
bool | operator< (const PObject &obj) const |
bool | operator<= (const PObject &obj) const |
bool | operator== (const PObject &obj) const |
bool | operator> (const PObject &obj) const |
bool | operator>= (const PObject &obj) const |
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 } |
Run Time Type functions | |
virtual const char * | GetClass (unsigned=0) const |
virtual BOOL | InternalIsDescendant (const char *clsName) const |
BOOL | IsClass (const char *cls) const |
static const char * | Class () |
I/O functions | |
virtual void | PrintOn (ostream &strm) const |
virtual void | ReadFrom (istream &strm) |
ostream & | operator<< (ostream &strm, const PObject &obj) |
istream & | operator>> (istream &strm, PObject &obj) |
Public Member Functions | |
void | Acknowledge () |
unsigned | GetInitial () const |
unsigned | GetMaxCount () const |
void | Signal (const PTimeInterval &waitTime) |
virtual void | Signal () |
Miscellaneous functions | |
virtual PObject * | Clone () const |
virtual PINDEX | HashFunction () const |
Operations | |
virtual BOOL | Wait (const PTimeInterval &timeout) |
virtual void | Wait () |
virtual BOOL | WillBlock () const |
Protected Member Functions | |
PQUEUE (ThreadQueue, PThread) | |
Protected Attributes | |
PSyncPoint | ack |
unsigned | initialVar |
unsigned | maxCountVar |
ThreadQueue | waitQueue |
Private Member Functions | |
PCLASSINFO (PSyncPointAck, PSyncPoint) |