xoreos  0.0.5
Public Member Functions | Private Attributes | List of all members
Common::StackLock Class Reference

Convenience class that locks a mutex on creation and unlocks it on destruction. More...

#include <mutex.h>

Inheritance diagram for Common::StackLock:
Inheritance graph
[legend]
Collaboration diagram for Common::StackLock:
Collaboration graph
[legend]

Public Member Functions

 StackLock (Mutex &mutex)
 
 StackLock (Semaphore &semaphore)
 
 ~StackLock ()
 

Private Attributes

Mutex_mutex
 
Semaphore_semaphore
 

Detailed Description

Convenience class that locks a mutex on creation and unlocks it on destruction.

Definition at line 71 of file mutex.h.

Constructor & Destructor Documentation

◆ StackLock() [1/2]

Common::StackLock::StackLock ( Mutex mutex)

Definition at line 84 of file mutex.cpp.

References _mutex, and Common::Mutex::lock().

Here is the call graph for this function:

◆ StackLock() [2/2]

Common::StackLock::StackLock ( Semaphore semaphore)

Definition at line 88 of file mutex.cpp.

References _semaphore, and Common::Semaphore::lock().

Here is the call graph for this function:

◆ ~StackLock()

Common::StackLock::~StackLock ( )

Definition at line 92 of file mutex.cpp.

References _mutex, _semaphore, Common::Mutex::unlock(), and Common::Semaphore::unlock().

Here is the call graph for this function:

Member Data Documentation

◆ _mutex

Mutex* Common::StackLock::_mutex
private

Definition at line 78 of file mutex.h.

Referenced by StackLock(), and ~StackLock().

◆ _semaphore

Semaphore* Common::StackLock::_semaphore
private

Definition at line 79 of file mutex.h.

Referenced by StackLock(), and ~StackLock().


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