ESA JPIP server  0.1
ipc::Mutex Class Reference

IPC object that offers the functionality of a mutex, implemented by means of the pthread mutex API. More...

#include <mutex.h>

Inheritance diagram for ipc::Mutex:
Collaboration diagram for ipc::Mutex:

Public Types

typedef SHARED_PTR< MutexPtr
 Pointer to a Mutex object. More...
 
- Public Types inherited from ipc::IPCObject
typedef SHARED_PTR< IPCObjectPtr
 Pointer to an IPC object. More...
 

Public Member Functions

virtual bool Init ()
 Initializes the object without locking the mutex. More...
 
bool Init (bool initial_owner)
 Initializes the object. More...
 
virtual WaitResult Wait (int time_out=-1)
 Performs a wait operation with the object to get it. More...
 
virtual bool Dispose ()
 Release the resources associated to the IPC object and sets the internal status to false. More...
 
bool Release ()
 Releases/unlocks the mutex. More...
 
- Public Member Functions inherited from ipc::IPCObject
 IPCObject ()
 Initializes the internal status to false. More...
 
bool IsValid ()
 Returns true if the object is valid, that is, the internal status value is true. More...
 
virtual ~IPCObject ()
 The desctructor calls the method Dispose. More...
 

Private Attributes

pthread_t locker
 Id. of the thread that locks the mutex. More...
 
pthread_mutex_t mutex
 Mutex information. More...
 

Detailed Description

IPC object that offers the functionality of a mutex, implemented by means of the pthread mutex API.

See also
IPCObject

Member Typedef Documentation

Pointer to a Mutex object.

Member Function Documentation

bool ipc::Mutex::Dispose ( )
virtual

Release the resources associated to the IPC object and sets the internal status to false.

Returns
true if successful.

Reimplemented from ipc::IPCObject.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool ipc::Mutex::Init ( )
inlinevirtual

Initializes the object without locking the mutex.

Returns
true if successful.

Reimplemented from ipc::IPCObject.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ipc::Mutex::Init ( bool  initial_owner)

Initializes the object.

Parameters
initial_ownerIf true the mutex is locked.
Returns
true if successful.

Here is the call graph for this function:

bool ipc::Mutex::Release ( )

Releases/unlocks the mutex.

Returns
true if successful.

Here is the call graph for this function:

Here is the caller graph for this function:

WaitResult ipc::Mutex::Wait ( int  time_out = -1)
virtual

Performs a wait operation with the object to get it.

Parameters
time_outTime out (infinite by default).
Returns
WAIT_OBJECT if successful, WAIT_TIMEOUT if time out or WAIT_ERROR is error.

Reimplemented from ipc::IPCObject.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

pthread_t ipc::Mutex::locker
private

Id. of the thread that locks the mutex.

pthread_mutex_t ipc::Mutex::mutex
private

Mutex information.


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