Merge branch 'master' of /home/git/random-fuzzer into thread-switch
[c11tester.git] / mutex.cc
index 27e4a080a69de852f57295e46ad34f9e59e84464..8b5d33b23e64f0c090633a498b330a9fd208eca4 100644 (file)
--- a/mutex.cc
+++ b/mutex.cc
@@ -8,13 +8,17 @@
 
 namespace cdsc {
 
-mutex::mutex()
+mutex::mutex(int type)
 {
        state.locked = NULL;
        thread_id_t tid = thread_current()->get_id();
        state.alloc_tid = tid;
        ClockVector *cv = model->get_execution()->get_cv(tid);
        state.alloc_clock = cv  == NULL ? 0 : cv->getClock(tid);
+
+       // For recursive mutex
+       state.type = type;
+       state.lock_count = 0;
 }
 
 void mutex::lock()