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

 

LMutexSemaphore



Overview:

LMutexSemaphore is a PowerPlant class that is used for implementing a mutually-exclusive semaphore.

Methods :

The methods in this class are:

 

LMutexSemaphore()  
~LMutexSemaphore()  
Signal()  
Wait()  

Data Members:

The data members in this class are:

 

mOwner  
mNestedWaits  

Operation:

If a mutually-exclusive semaphore is raised, only one thread may access the flagged data. When the semaphore is lowered, if there are waiting threads, opnly one waiting thread is returned to the ready state.

Source files:

(Threads Classes)

LMutexSemaphore.h

LMutexSemaphore.cp

See also:

LSemaphore

LMutexSemaphore()

Purpose:

The constructor creates the object.

Access :

Public

Prototype:

LLMutexSemaphore();

LMutexSemaphore(Boolean owned);
Parameters:

Indicate whether the semaphore is already owned or not. If owned is true, the semaphore is marked as belonging to the current thread.

~LMutexSemaphore()

Purpose:

The destructor destroys the LMutexSemaphore object.

Access :

Virtual

Prototype:

virtual ~LMutexSemaphore();

Signal()

Purpose:

This is an override of Signal() in LSemaphore. If the owning semaphore called Wait() more than once, this function merely decrements a usage count. Else, if any threads are waiting on the semaphore, one of them is unblocked. If the current thread doesn't own the semaphore, the errSemaphoreNotOwner exception is thrown.

Wait()

Purpose:

This is an override of Wait() in LSemaphore.

mOwner

Purpose:

The owner.

Access :

Protected

Prototype:

LThread		*mOwner;

mNestedWaits

Purpose:

The number of nested waits

Access :

Protected

Prototype:

UInt32		mNestedWaits;

[ 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