Mutex.cpp
Go to the documentation of this file.
1 
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:15
~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:40
void lock()
Definition: Mutex.cpp:47


sick_scan
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Tue Jul 9 2019 04:55:32