X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=mutex.cc;h=fa751783dcc4418ddc8087e7ee5b24d566c412a5;hb=HEAD;hp=27e4a080a69de852f57295e46ad34f9e59e84464;hpb=edf082882ea7a2d27d3a3322a84e42b040f186a4;p=c11tester.git diff --git a/mutex.cc b/mutex.cc index 27e4a080..fa751783 100644 --- 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(); + thread_id_t tid = thread_current_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()