NLMEMORY::CMemoryMutex Class Reference

#include <memory_mutex.h>


Detailed Description

Mutex used by the memory manager

Author:
Cyril 'Hulud' Corvazier

Nevrax France

Date:
2002

Definition at line 51 of file memory_mutex.h.

Public Member Functions

 CMemoryMutex ()
 Constructor.

void enter ()
void leave ()
 ~CMemoryMutex ()
 Destructor.


Private Attributes

sem_t _Sem


Constructor & Destructor Documentation

NLMEMORY::CMemoryMutex::CMemoryMutex  ) 
 

Constructor.

Definition at line 49 of file memory_mutex.cpp.

References _Sem.

00050 {
00051         sem_init( const_cast<sem_t*>(&_Sem), 0, 1 );
00052 }

NLMEMORY::CMemoryMutex::~CMemoryMutex  ) 
 

Destructor.

Definition at line 56 of file memory_mutex.cpp.

References _Sem.

00057 {
00058         sem_destroy( const_cast<sem_t*>(&_Sem) ); // needs that no thread is waiting on the semaphore
00059 }


Member Function Documentation

void NLMEMORY::CMemoryMutex::enter  ) 
 

Definition at line 63 of file memory_mutex.cpp.

References _Sem.

00064 {
00065         sem_wait( const_cast<sem_t*>(&_Sem) );
00066 }

void NLMEMORY::CMemoryMutex::leave  ) 
 

Definition at line 70 of file memory_mutex.cpp.

References _Sem.

00071 {
00072         sem_post( const_cast<sem_t*>(&_Sem) );
00073 }


Field Documentation

sem_t NLMEMORY::CMemoryMutex::_Sem [private]
 

Definition at line 134 of file memory_mutex.h.

Referenced by CMemoryMutex(), enter(), leave(), and ~CMemoryMutex().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 12:56:50 2004 for NeL by doxygen 1.3.6