Celartem::Semaphore Class Reference

#include <cel_syncobjs.h>

Inheritance diagram for Celartem::Semaphore:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 Semaphore (size_t inMax, const String &inName=NullString)
virtual void lock () const
virtual void unlock () const


Detailed Description

This class implements the semaphore.
This class has its own DataTraits structure and it can be used with SimpleArray with some special restrictions; you can create, allocate, release the array of Semaphore instances but you could not reallocate (resize) the array.
See also:
Mutex, Lockable, Locker, SimpleArray

Definition at line 79 of file cel_syncobjs.h.


Constructor & Destructor Documentation

Celartem::Semaphore::Semaphore ( size_t  inMax,
const String inName = NullString 
)

This constuctor creates a new anonymous/named semaphore or opens an existing named semaphore.

Parameters:
inMax The size of the semaphore.
inName The name of the semaphore. For anonymous semaphore, this should be "".


Member Function Documentation

virtual void Celartem::Semaphore::lock (  )  const [virtual]

Locks the semaphore. The recursive locks in the same thread are counted, this behavior is not compatible with Mutex. For exception-safe programming, you should use Locker class instead of calling lock and unlock directly.

See also:
Locker

Implements Celartem::Lockable.

virtual void Celartem::Semaphore::unlock (  )  const [virtual]

Unlocks the semaphore.
For exception-safe programming, you should use Locker class instead of calling lock and unlock directly.

See also:
Locker

Implements Celartem::Lockable.


The documentation for this class was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:24 2008.