projects
/
model-checker.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
cyclegraph: small cleanup
[model-checker.git]
/
include
/
mutex
1
/**
2
* @file mutex
3
* @brief C++11 mutex interface header
4
*/
5
6
#ifndef __CXX_MUTEX__
7
#define __CXX_MUTEX__
8
9
#include "modeltypes.h"
10
11
namespace std {
12
struct mutex_state {
13
bool islocked;
14
thread_id_t alloc_tid;
15
modelclock_t alloc_clock;
16
};
17
18
class mutex {
19
public:
20
mutex();
21
~mutex() {}
22
void lock();
23
bool try_lock();
24
void unlock();
25
struct mutex_state * get_state() {return &state;}
26
27
private:
28
struct mutex_state state;
29
};
30
}
31
#endif /* __CXX_MUTEX__ */