EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | List of all members
EMutexLock Class Reference

Acquires and holds a lock on the specified mutex. More...

#include <esynch.h>

Public Member Functions

 EMutexLock (EMutexData &mtx, Bool acquire=True)
 Class constructor. More...
 
 ~EMutexLock ()
 Class destructor. Unlocks the mutex if locked. More...
 
Bool acquire (Bool wait=True)
 Manually acquires a lock on the mutex. More...
 

Detailed Description

Acquires and holds a lock on the specified mutex.

Constructor & Destructor Documentation

◆ EMutexLock()

EMutexLock::EMutexLock ( EMutexData mtx,
Bool  acquire = True 
)
inline

Class constructor.

Parameters
mtxthe mutex to lock.
acquireif True, the associated mutex is locked in the constructor.

◆ ~EMutexLock()

EMutexLock::~EMutexLock ( )
inline

Class destructor. Unlocks the mutex if locked.

Member Function Documentation

◆ acquire()

Bool EMutexLock::acquire ( Bool  wait = True)
inline

Manually acquires a lock on the mutex.

Parameters
waitdirects the method to wait for the mutex to be locked.
Returns
True indicates that the lock was acquired, otherwise False.

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