nodestack: add release sequence breakage backtracking
[c11tester.git] / mutex.h
1 #ifndef MUTEX_H
2 #define MUTEX_H
3
4 #include "modeltypes.h"
5
6 namespace std {
7         struct mutex_state {
8                 bool islocked;
9                 thread_id_t alloc_tid;
10                 modelclock_t alloc_clock;
11         };
12
13         class mutex {
14         public:
15                 mutex();
16                 ~mutex();
17                 void lock();
18                 bool try_lock();
19                 void unlock();
20                 struct mutex_state * get_state() {return &state;}
21                 
22         private:
23                 struct mutex_state state;
24         };
25 }
26 #endif