Compute the threads that a paused thread my wait for
[c11tester.git] / mutex.cc
index 44f64ff764b3c0c80a2c789d4f5bfcff40a7ef1e..0776db8eef5857b34c47bdbf3493194c9672097a 100644 (file)
--- a/mutex.cc
+++ b/mutex.cc
@@ -13,7 +13,8 @@ mutex::mutex()
        state.locked = NULL;
        thread_id_t tid = thread_current()->get_id();
        state.alloc_tid = tid;
-       state.alloc_clock = model->get_execution()->get_cv(tid)->getClock(tid);
+       ClockVector *cv = model->get_execution()->get_cv(tid);
+       state.alloc_clock = cv  == NULL ? 0 : cv->getClock(tid);
 }
 
 void mutex::lock()