Public Member Functions | Private Attributes | List of all members
icl_core::thread::ScopedMutexLock Class Reference

Manages locking and unlocking of a mutes. More...

#include <ScopedMutexLock.h>

Inheritance diagram for icl_core::thread::ScopedMutexLock:
Inheritance graph
[legend]

Public Member Functions

bool isLocked () const
 
 operator bool () const
 
 ScopedMutexLock (Mutex &mutex, bool force=true)
 
 ~ScopedMutexLock ()
 

Private Attributes

bool m_is_locked
 
Mutexm_mutex
 

Additional Inherited Members

- Protected Member Functions inherited from icl_core::Noncopyable
 Noncopyable ()
 
virtual ~Noncopyable ()
 

Detailed Description

Manages locking and unlocking of a mutes.

Locks or tries to lock a mutex in the constructor and unlocks it in the destructor.

Definition at line 50 of file ScopedMutexLock.h.

Constructor & Destructor Documentation

icl_core::thread::ScopedMutexLock::ScopedMutexLock ( Mutex mutex,
bool  force = true 
)
explicit

Locks the mutex.

Parameters
mutexThe mutex to use.
forceEnsure at all cost that IsLocked() is true.

Definition at line 30 of file ScopedMutexLock.cpp.

icl_core::thread::ScopedMutexLock::~ScopedMutexLock ( )

Unlocks the mutex.

Definition at line 40 of file ScopedMutexLock.cpp.

Member Function Documentation

bool icl_core::thread::ScopedMutexLock::isLocked ( ) const
inline

Check if the mutex has been successfully locked.

Definition at line 64 of file ScopedMutexLock.h.

icl_core::thread::ScopedMutexLock::operator bool ( ) const
inline

Implicit conversion to bool.

Definition at line 68 of file ScopedMutexLock.h.

Member Data Documentation

bool icl_core::thread::ScopedMutexLock::m_is_locked
private

Definition at line 83 of file ScopedMutexLock.h.

Mutex& icl_core::thread::ScopedMutexLock::m_mutex
private

Definition at line 82 of file ScopedMutexLock.h.


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


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59