[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LEventSemaphore



Overview:

LEventSemaphore is a PowerPlant class that overrides LSemaphore.

Methods :

The methods in this class are:

 

LEventSemaphore()  
~LEventSemaphore()  
Reset()  
Signal()  

Data Members:

The data members in this class are:

 

mPostCount  
 

Operation:

The Signal() method is overridden so that it can be made to simultaneously release all threads waiting on this semaphore. The Reset() method is guaranteed to raise the semaphore so that no thread can access the flagged data until the next call to Signal().

Source files:

(Thread Classes)

LEventSemaphore.h

LEventSemaphore.cp

See also:

LSemaphore

LEventSemaphore()

Purpose:

The constructor creates the object.

Access :

Public

Prototype:

LEventSemaphore();

LEventSemaphore(Boolean posted);
Parameters:

A Boolean indicating whether the semaphore is posted or not. If posted is true, the semaphore is marked as being in the posted state, and any calls to Wait() will return immediately.

~LEventSemaphore()

Purpose:

The destructor destroys the object.

Access :

Virtual, Public

Prototype:

~LEventSemaphore();

Reset()

Purpose:

Guaranteed to raise the semaphore so that no thread can access the flagged data until the next call to Signal(). Throws an exception if the semaphore is already reset.

Access :

Virtual, Public

Prototype:

virtual UInt32 Reset();
Parameters:

None

Return:

Returns the number of times that Signal() was called since the last call to Reset().

Signal()

Purpose:

Make the semaphore available to all threads. This includes all blocked threads, as well as those that will call Wait() before the next call to Reset(). This is an override of Signal() in LSemaphore.

Access :

Virtual

Prototype:

virtual void Signal();
Parameters:

None

Return:

None

mPostCount

Purpose:

The "post" counter

Access :

protected

Prototype:

UInt32	 mPostCount;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000