Mutex
Lock
defines the interface of any object implementing lock
and unlock
.
Class SafeLock
locks its argument's constructor in the
constructor itself and unlock it upon deletion. It accepts any
Lock
instances. This allow a safe lock/unlock balancing call when
entering/leaving functions or when exceptions are used. A family of
macros (SAFELOCK
, SAFELOCK1
,...) are defined making its
use straightforward and concise.
Mutex
is the DEFAULT
implementation class whose inherit
FastMutex
, DebugMutex
, RecursiveMutex
.
class Lock { public : virtual void lock() = 0; virtual void unlock() = 0; } class Mutex : public Lock { public: virtual void lock(); virtual void unlock(); virtual CV *createCV(); static Mutex* create (); static void destroy (Mutex*); } class FastMutex : public Mutex; class RecursiveMutex : public Mutex; class DebugMutex : public Mutex;
Mutex
instance.
RECURSIVE
one .
RECURSIVE
one, the mutex may be already owned by the
calling thread. In that case, there must be as many unlock
invocations than there has been lock
invocations on this mutex,
in order to release it.
Go to the first, previous, next, last section, table of contents.