dcrud
0.0.0
Distributed data and services
Main Page
Namespaces
Data Structures
Files
File List
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Mutex.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <os/Mutex.h>
4
5
namespace
os {
6
7
class
Mutex
{
8
private
:
9
10
osMutex _mutex;
11
12
Mutex
(
const
Mutex
& );
13
Mutex
& operator = (
const
Mutex
& );
14
15
public
:
16
17
Mutex
() {
18
osMutex_new( &_mutex );
19
}
20
21
~ Mutex
() {
22
osMutex_delete( &_mutex );
23
}
24
25
public
:
26
27
int
take
() {
28
return
osMutex_take( _mutex );
29
}
30
31
int
release
() {
32
return
osMutex_release( _mutex );
33
}
34
};
35
36
class
Synchronized
{
37
public
:
38
39
Synchronized
(
Mutex
& mutex ) :
40
_mutex( mutex )
41
{
42
_mutex.
take
();
43
}
44
45
~ Synchronized
() {
46
_mutex.
release
();
47
}
48
49
private
:
50
51
Mutex
& _mutex;
52
53
private
:
54
Synchronized
(
const
Synchronized
& );
55
Synchronized
& operator = (
const
Synchronized
& );
56
};
57
}
os::Mutex
Definition:
Mutex.hpp:7
os::Mutex::~Mutex
~Mutex()
Definition:
Mutex.hpp:21
os::Mutex::take
int take()
Definition:
Mutex.hpp:27
os::Synchronized
Definition:
Mutex.hpp:36
os::Mutex::release
int release()
Definition:
Mutex.hpp:31
os::Synchronized::Synchronized
Synchronized(Mutex &mutex)
Definition:
Mutex.hpp:39
os::Synchronized::~Synchronized
~Synchronized()
Definition:
Mutex.hpp:45
os::Mutex::Mutex
Mutex()
Definition:
Mutex.hpp:17
inc
os
Mutex.hpp
Generated on Sun Jan 10 2016 19:24:09 for dcrud by
1.8.7