add support for pthread_mutex
[c11tester.git] / include / mutex
index 31fd7eb1f19ae83ae750a0bbf23f629a3b7d96e3..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 {
        public:
                mutex();
-               ~mutex();
+               ~mutex() {}
                void lock();
                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;