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

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions

PSyncPoint Class Reference

#include <syncpoint.h>

Inheritance diagram for PSyncPoint:
Inheritance graph
[legend]
Collaboration diagram for PSyncPoint:
Collaboration graph
[legend]

List of all members.

Public Member Functions

unsigned GetInitial () const
unsigned GetMaxCount () const
 PSyncPoint ()
 PSyncPoint (const PSyncPoint &)
Operations
virtual void Wait ()
virtual BOOL Wait (const PTimeInterval &timeout)
virtual void Signal ()
virtual BOOL WillBlock () const
Miscellaneous functions
virtual PObjectClone () const
virtual PINDEX HashFunction () const

Protected Member Functions

 PQUEUE (ThreadQueue, PThread)

Protected Attributes

unsigned initialVar
unsigned maxCountVar
ThreadQueue waitQueue

Private Member Functions

 PCLASSINFO (PSyncPoint, PSemaphore)

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
BOOL IsClass (const char *cls) const
virtual BOOL InternalIsDescendant (const char *clsName) const
static const char * Class ()

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 }

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)

Detailed Description

This class defines a thread synchonisation object. This form of semaphore is used to indicate an { event} has occurred. A thread may block on theis sync point and wait until another thread signals that it may continue. eg: {verbatim} ... thread one while (condition) { sync.Wait(); do_something(); }

... thread 2 do_something_else(); sync.Signal(); // At this point thread 1 wake up and does something. do_yet_more();

{verbatim}

Definition at line 95 of file syncpoint.h.


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

Generated by  Doxygen 1.6.0   Back to index