ApparatusFramework::Mutex Class Reference
[Kernel Services]

#include <KernelServices/Win32/current/include/Mutex.h>

List of all members.

Public Member Functions

 Mutex (const uint8 initialValue=1)
 Mutex (const Mutex &lvalue)
 ~Mutex ()
Mutexoperator= (const Mutex &lvalue)
void get ()
void put ()

Detailed Description

The mutex class implements the mutual exclusion concept as described in the seminal work from O'Hoare. A mutex is in fact a semaphore with a maximum count of one. This class is a mixin class.

Definition at line 56 of file Mutex.h.


Constructor & Destructor Documentation

ApparatusFramework::Mutex::Mutex ( const uint8  initialValue = 1  )  [explicit]

constructors, destructors Constructs a new mutex object. All instance variables are initialized to their default values.

Parameters:
initialValue initial value of the mutex object.
ApparatusFramework::Mutex::Mutex ( const Mutex lvalue  ) 

The copy constructor constructs a new mutex object.

Parameters:
lvalue monitor used to generate a new object.
ApparatusFramework::Mutex::~Mutex (  ) 

Destroys a mutex object and releases all the associated ressources.


Member Function Documentation

void ApparatusFramework::Mutex::get (  ) 

modifiers Decrements the value of the counter by one. If the value is negative suspend the calling task.

Postcondition:
(m_value == m_value' - 1) && ((m_value < 0) && task.suspended())
Mutex& ApparatusFramework::Mutex::operator= ( const Mutex lvalue  ) 

operators The copy operator constructs a new mutex object.

Parameters:
lvalue mutex object to be copied.
Returns:
The newly copied object.
void ApparatusFramework::Mutex::put (  ) 

Increments the value of the counter by one. If the value is positive and at least one task is pending, wakes up the longest waiting task.

Postcondition:
(m_value == m_value' + 1) && (m_value <= 1)
© 2004-2010 bbv Software Services AG / Apparatus Services