OpenRTM-aist
1.2.1
総合概要
名前空間
クラス
ファイル
ファイル一覧
ファイルメンバ
coil
include
coil
Mutex.h
[詳解]
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
coil::Mutex
Mutex クラス
Definition:
Mutex.h:40
coil::Mutex::lock
void lock()
排他制御のロック
Definition:
Mutex.h:102
coil::Mutex::~Mutex
~Mutex()
デストラクタ
Definition:
Mutex.h:82
coil::Mutex::unlock
void unlock()
排他制御のロック解除
Definition:
Mutex.h:142
coil::Mutex::trylock
bool trylock()
排他制御のノンブロッキングロック
Definition:
Mutex.h:122
coil::Mutex::Mutex
Mutex(const char *const name=0)
コンストラクタ
Definition:
Mutex.h:62
coil::Mutex::mutex_
pthread_mutex_t mutex_
排他制御オブジェクト
Definition:
Mutex.h:158
coil
Common Object Interface Layer.
Definition:
Affinity.h:28
構築:
1.8.11