1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| #ifndef EFSW_LOCK_HPP
| #define EFSW_LOCK_HPP
|
| #include <efsw/Mutex.hpp>
|
| namespace efsw {
|
| /** Simple mutex class */
| class Lock {
| public:
| explicit Lock( Mutex& mutex ) :
| mMutex( mutex )
| {
| mMutex.lock();
| }
|
| ~Lock()
| {
| mMutex.unlock();
| }
| private:
| Mutex& mMutex;
| };
|
| }
|
| #endif
|
|