My Project
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Enumerations
Enumerator
Friends
Macros
Pages
Mutex.h
Go to the documentation of this file.
1
#ifndef GCP_UTIL_MUTEX_H
2
#define GCP_UTIL_MUTEX_H
3
11
#include <pthread.h>
12
13
namespace
gcp {
14
namespace
util {
15
16
class
Mutex
{
17
public
:
18
22
Mutex
();
23
27
virtual
~Mutex
();
28
29
void
lock
();
30
31
void
unlock
();
32
36
bool
tryLock
();
37
43
bool
isLocked
();
44
45
inline
pthread_mutex_t getPthreadVar() {
46
return
mutex_;
47
}
48
49
inline
pthread_mutex_t* getPthreadVarPtr() {
50
return
&mutex_;
51
}
52
53
bool
isItMe
();
54
55
private
:
56
57
pthread_mutex_t mutex_;
58
bool
mutexIsReady_;
59
pthread_t who_;
// The identity of the thread who currently has the lock
60
61
};
// End class Mutex
62
63
}
// End namespace util
64
}
// End namespace gcp
65
66
67
68
#endif // End #ifndef GCP_UTIL_MUTEX_H
gcp::util::Mutex::unlock
void unlock()
Definition:
Mutex.cc:104
gcp::util::Mutex::isLocked
bool isLocked()
Definition:
Mutex.cc:148
gcp::util::Mutex::lock
void lock()
Definition:
Mutex.cc:72
gcp::util::Mutex
Definition:
Mutex.h:16
gcp::util::Mutex::Mutex
Mutex()
Definition:
Mutex.cc:15
gcp::util::Mutex::isItMe
bool isItMe()
Definition:
Mutex.cc:167
gcp::util::Mutex::~Mutex
virtual ~Mutex()
Definition:
Mutex.cc:50
gcp::util::Mutex::tryLock
bool tryLock()
Definition:
Mutex.cc:128
gcpCbass
util
common
Mutex.h
Generated on Thu Jun 21 2018 14:30:00 for My Project by
1.8.6