Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PSyncPointAck Class Reference

#include <syncthrd.h>

Inheritance diagram for PSyncPointAck:

PSyncPoint PSemaphore PObject

List of all members.

Detailed Description

This class defines a thread synchonisation object.

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.


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 PObjectClone () const
virtual PINDEX HashFunction () const
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)

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

Generated by  Doxygen 1.6.0   Back to index