Public Member Functions | List of all members
Celartem::Semaphore Class Reference

#include <cel_syncobjs.h>

Inheritance diagram for Celartem::Semaphore:
Inheritance graph
[legend]

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

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
inMaxThe size of the semaphore.
inNameThe 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:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo