add support for condition variable
[c11tester.git] / include / mutex
index 482af590068c2f1ae9b4b24637a83c8a9b098a92..734ec124502a496c9871527deccacd30deaa3109 100644 (file)
 
 namespace std {
        struct mutex_state {
-               bool islocked;
+               void *locked; /* Thread holding the lock */
                thread_id_t alloc_tid;
                modelclock_t alloc_clock;
+               int init; // WL
        };
 
        class mutex {
@@ -23,6 +24,8 @@ namespace std {
                bool try_lock();
                void unlock();
                struct mutex_state * get_state() {return &state;}
+               void initialize() { state.init = 1; } // WL
+               bool is_initialized() { return state.init == 1; }
                
        private:
                struct mutex_state state;