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

#include <CriticalSection.h>

Classes

class  Impl
 

Public Member Functions

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

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

Mutex::Mutex ( )

Create unamed mutex

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

Create a named mutex

Parameters
mutexname
createif false does not create mutex
Mutex::~Mutex ( )

Member Function Documentation

bool Mutex::create ( const AChar name)
bool Mutex::is_ok ( )
Returns
true if mutex exists
bool Mutex::lock ( )

Lock mutex (wait until mutex become free)

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

Try lock mutex with timeout

Returns
true if lock succed
bool Mutex::open ( const AChar name)
bool Mutex::try_lock ( )

Try lock mutex (does not wait )

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

Release mutex

Returns
false if mutex does not exist

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