Semaphore Class Reference

Inheritance diagram for Semaphore:

Synchronizer_Common

List of all members.

Public Member Functions

 Semaphore (int v=1)
 ~Semaphore ()
void p ()
void v ()
void freeResources ()

Static Public Member Functions

static int init (System_Info *si)

Private Attributes

volatile int _value

Static Private Attributes

static const Type_Id TYPE = Type<Semaphore>::TYPE


Detailed Description

that gives support to general sync
Author:
Group 06

Definition at line 20 of file semaphore.h.


Constructor & Destructor Documentation

Semaphore::Semaphore ( int  v = 1  )  [inline]

Default constructor

Parameters:
v the number of

Definition at line 26 of file semaphore.h.

Semaphore::~Semaphore (  )  [inline]

Destructor. Frees all Threads that were waiting on the Semaphore instance

Definition at line 33 of file semaphore.h.


Member Function Documentation

void Semaphore::freeResources (  )  [inline]

Frees all resources locked by this Semaphore

Definition at line 60 of file semaphore.h.

__BEGIN_SYS int Semaphore::init ( System_Info *  si  )  [static]

System init call (Object system constructor)

Returns:
0 if the initializing went fine and something else otherwise

Definition at line 12 of file semaphore_init.cc.

void Semaphore::p (  )  [inline]

Locks one semaphore resource. If no resources are currently available then waits until one become available

Definition at line 42 of file semaphore.h.

void Semaphore::v (  )  [inline]

Unlocks one semaphore resource. Wakes one locked Thread

Definition at line 51 of file semaphore.h.


Member Data Documentation

volatile int Semaphore::_value [private]

Current value of the Semaphore counter

Definition at line 74 of file semaphore.h.

const Type_Id Semaphore::TYPE = Type<Semaphore>::TYPE [static, private]

Internal Semaphore Type_Id

Definition at line 72 of file semaphore.h.


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

Generated on Mon May 4 09:42:22 2009 for EPOS-- by  doxygen 1.5.8