OpenRTM
1.0.0
Main Page
Namespaces
Classes
Files
File List
File Members
tmp
binarydeb
ros-indigo-openrtm-aist-1.1.0
src
lib
coil
include
coil
Mutex.h
Go to the documentation of this file.
1
// -*- C++ -*-
20
#ifndef COIL_MUTEX_H
21
#define COIL_MUTEX_H
22
23
#include <pthread.h>
24
25
namespace
coil
26
{
40
class
Mutex
41
{
42
public
:
62
Mutex
(
const
char
*
const
name = 0)
63
{
64
::pthread_mutex_init(&
mutex_
, 0);
65
}
66
82
~Mutex
()
83
{
84
::pthread_mutex_destroy(&
mutex_
);
85
}
86
102
inline
void
lock
()
103
{
104
::pthread_mutex_lock(&
mutex_
);
105
}
106
122
inline
bool
trylock
()
123
{
124
return ::pthread_mutex_trylock(&
mutex_
);
125
}
126
142
inline
void
unlock
()
143
{
144
::pthread_mutex_unlock(&
mutex_
);
145
}
146
158
pthread_mutex_t
mutex_
;
159
160
private
:
161
Mutex
(
const
Mutex
&);
162
Mutex
& operator=(
const
Mutex
&);
163
};
164
};
165
#endif // COIL_MUTEX_H
Generated on Sun Mar 12 2017 16:20:45 for OpenRTM by
1.8.4