class CMutex

More...

Definition#include <classlib/include/classlib/mtsync.h>
InheritsCSyncObject [public ]
Inherited byCCriticalSection
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

class CMutex

Class implementing a mutex object. A mutex is a sinchronization object for multithread programming. Only one thread at a time can take the object.

 CMutex ()

CMutex

Create a standard mutex object not signaled.

 CMutex (const pthread_mutexattr_t *mutexattr)

CMutex

Create a mutex object with extra parameter.

 ~CMutex ()

~CMutex

[virtual]

Destroy the mutex object.

int  Lock ()

Lock

[virtual]

The calling thread try to acquire the object. If another thread have called the Lock() function on the same object, the calling thread go in suspend mode until someone call Unlock() to free the resource. When Unlock() as called the waiting thread restart in the call order to Lock().

Reimplemented from CSyncObject.

int  Unlock ()

Unlock

[virtual]

The calling thread release the resource, signaling to other waiting thread to restart.

Reimplemented from CSyncObject.

int  Try ()

Try

[virtual]

Try to acquire the locking without really lock the thread. Not yet implemented.

Reimplemented from CSyncObject.

pthread_mutex_t mutex

mutex

[protected]


Generated by: nicola on gulliver.wadahome.it on Sun May 25 13:54:34 2003, using kdoc 2.0a53.