#include "mutex.h"
#include "model.h"
-
namespace std {
-mutex::mutex() :
- owner(0), islocked(false)
-{
-
+mutex::mutex() {
+ state.islocked=false;
+ thread_id_t tid=thread_current()->get_id();
+ state.alloc_tid=tid;
+ state.alloc_clock=model->get_cv(tid)->getClock(tid);
}
void mutex::lock() {