Mutex.cpp
Go to the documentation of this file.
1 
5 #include "Mutex.hpp"
6 #include "errorhandler.hpp"
7 
8 // ****************************************************************************
9 // ScopedLock
10 // ****************************************************************************
11 
12 // Konstruktor.
13 // Lock sperren.
15 {
16  m_mutexPtr = mutexPtr;
17  if (m_mutexPtr != NULL)
18  {
19  m_mutexPtr->lock();
20  }
21 }
22 
23 // Destruktor.
24 // Lock wieder freigeben.
26 {
27  if (m_mutexPtr != NULL)
28  {
29  m_mutexPtr->unlock();
30  }
31 }
32 
33 
34 
35 // ****************************************************************************
36 // Mutex
37 // ****************************************************************************
39 {
40  pthread_mutex_init (&m_mutex, NULL);
41 }
42 
44 {
45 }
46 
48 {
49  pthread_mutex_lock(&m_mutex);
50 }
51 
53 {
54  pthread_mutex_unlock(&m_mutex);
55 }
Mutex()
Definition: Mutex.cpp:38
Definition: Mutex.hpp:16
~ScopedLock()
Definition: Mutex.cpp:25
~Mutex()
Definition: Mutex.cpp:43
ScopedLock(Mutex *mutexPtr)
Definition: Mutex.cpp:14
void unlock()
Definition: Mutex.cpp:52
Mutex * m_mutexPtr
Definition: Mutex.hpp:41
void lock()
Definition: Mutex.cpp:47


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Mon Oct 26 2020 03:27:30