CMutex Class Reference

Mutual exclusion. More...

#include <CMutex.h>

Collaboration diagram for CMutex:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CMutex (const CMutex &)
 Equivalent to default c'tor.
manipulators



CMutexoperator= (const CMutex &)
 Does nothing.
accessors



void lock () const
 Lock the mutex.
void unlock () const
 Unlock the mutex.

Friends

class CCondVarBase

Detailed Description

Mutual exclusion.

A non-recursive mutual exclusion object. Only one thread at a time can hold a lock on a mutex. Any thread that attempts to lock a locked mutex will block until the mutex is unlocked. At that time, if any threads are blocked, exactly one waiting thread will acquire the lock and continue running. A thread may not lock a mutex it already owns the lock on; if it tries it will deadlock itself.

Definition at line 29 of file CMutex.h.


Constructor & Destructor Documentation

CMutex::CMutex ( const CMutex  ) 

Equivalent to default c'tor.

Copy c'tor doesn't copy anything. It just makes it possible to copy objects that contain a mutex.

Definition at line 27 of file CMutex.cpp.


Member Function Documentation

void CMutex::lock (  )  const

Lock the mutex.

Locks the mutex, which must not have been previously locked by the calling thread. This blocks if the mutex is already locked by another thread.

(cancellation point)

Definition at line 44 of file CMutex.cpp.

Referenced by CLock::CLock(), and CCondVarBase::lock().

CMutex & CMutex::operator= ( const CMutex  ) 

Does nothing.

This does nothing. It just makes it possible to assign objects that contain a mutex.

Definition at line 38 of file CMutex.cpp.

void CMutex::unlock (  )  const

Unlock the mutex.

Unlocks the mutex, which must have been previously locked by the calling thread.

Definition at line 50 of file CMutex.cpp.

Referenced by CCondVarBase::unlock(), and CLock::~CLock().


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

Generated on 12 Nov 2010 for synergy-plus by  doxygen 1.6.1