gtkIOStream  1.7.0
GTK+ << C++ IOStream operators for GTK+. Now with ORBing, numerical computation, audio client and more ...
Mutex Class Reference

#include <Thread.H>

Inheritance diagram for Mutex:
[legend]

Public Member Functions

 Mutex ()
 
virtual ~Mutex ()
 
int lock ()
 
int tryLock ()
 
int unLock ()
 

Protected Attributes

pthread_mutex_t mut
 The POSIX mutex semaphore. More...
 

Detailed Description

Class to protext mutual exclusion zones.

Examples:
ThreadTest.C.

Definition at line 271 of file Thread.H.

Constructor & Destructor Documentation

◆ Mutex()

Mutex::Mutex ( )
inline

Constructor. Initialises the mutual exclusion device.

Definition at line 278 of file Thread.H.

◆ ~Mutex()

virtual Mutex::~Mutex ( )
inlinevirtual

Destroys the mutual exclusion device.

Definition at line 284 of file Thread.H.

Member Function Documentation

◆ lock()

int Mutex::lock ( )
inline

Lock the mutual exclusion zone.

Returns
NO_ERROR on success, the suitable error code otherwise (EINVAL, EDEADLK).
Examples:
IIOQueueTest.C, and ThreadTest.C.

Definition at line 295 of file Thread.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tryLock()

int Mutex::tryLock ( )
inline

Try to lock the mutual exclusion zone.

Returns
NO_ERROR on success, the suitable error code otherwise (EINVAL, EBUSY).

Definition at line 310 of file Thread.H.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unLock()

int Mutex::unLock ( )
inline

Try to lock the mutual exclusion zone.

Returns
NO_ERROR on success, the suitable error code otherwise (EINVAL, EPERM when using a error checking mutex).
Examples:
IIOQueueTest.C, and ThreadTest.C.

Definition at line 325 of file Thread.H.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mut

pthread_mutex_t Mutex::mut
protected

The POSIX mutex semaphore.

Definition at line 273 of file Thread.H.


The documentation for this class was generated from the following file:
gtkIOStream: Mutex Class Reference
GTK+ IOStream  Beta