commore  1.0.6-SNAPSHOT
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
commore::Mutex Class Reference

#include <CriticalSection.h>

Public Member Functions

 Mutex ()
 
 Mutex (const AChar *name, bool create)
 

mutex name

Open an existing named mutex

Returns
false if mutex does not exists.
bool create (const AChar *name)
 
bool open (const AChar *name)
 
bool lock ()
 
bool try_lock ()
 
bool lock (const TimePeriod &timeout)
 
bool unlock ()
 
bool is_ok ()
 

Detailed Description

System independant Mutex management

Constructor & Destructor Documentation

commore::Mutex::Mutex ( )

Create unamed mutex

commore::Mutex::Mutex ( const AChar *  name,
bool  create 
)

Create a named mutex

Parameters
mutexname
createif false does not create mutex

Member Function Documentation

bool commore::Mutex::is_ok ( )
Returns
true if mutex exists
bool commore::Mutex::lock ( )

Lock mutex (wait until mutex become free)

Returns
false if mutex not reated
bool commore::Mutex::lock ( const TimePeriod timeout)

Try lock mutex with timeout

Returns
true if lock succed
bool commore::Mutex::try_lock ( )

Try lock mutex (does not wait )

Returns
true if lock succed
bool commore::Mutex::unlock ( )

Release mutex

Returns
false if mutex does not exist

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