Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::system::IMutex Class Reference

#include <mutex.hh>

Inheritance diagram for mpcl::system::IMutex:

mpcl::system::TMutex List of all members.

Public Methods

virtual ~IMutex (void)
 Destroys the instance.

virtual void lock (void)=0
 Lock mutex.

virtual void unlock (void)=0
 Unlock mutex.

virtual bool tryLock (void)=0

Detailed Description

Mutex base class.

A mutex is a MUTual EXclusion device, and is useful for protecting shared data structures from concurrent modifications, and implementing critical sections and monitors.

A mutex has two possible states: unlocked (not owned by any thread), and locked (owned by one thread). A mutex can never be owned by two different threads simultaneously. A thread attempting to lock a mutex that is already locked by another thread is suspended until the owning thread unlocks the mutex first.

See also:
TBaseOperatingSystem.

Definition at line 53 of file mutex.hh.


Member Function Documentation

virtual bool mpcl::system::IMutex::tryLock void    [pure virtual]
 

Lock mutex if unlocked, if not, then it returns false.

Returns:
True if unlocked (locking it, if so).

Implemented in mpcl::system::TMutex.


The documentation for this class was generated from the following file:
Generated on Mon Oct 13 02:35:25 2003 for MPCL by doxygen1.2.18