X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7ba0fd48abab3f11773232e7ba9e0a7e2a6772c6..bdde4c97ef4a5c90e301b76c52da159005e43b55:/src/mc/mc_base.cpp diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index cfd63caaa1..42906fe22b 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -38,7 +38,6 @@ int MC_random(int min, int max) xbt_assert(mc_mode != MC_MODE_SERVER); /* TODO, if the MC is disabled we do not really need to make a simcall for * this :) */ - /* FIXME: return mc_current_state->executed_transition->random.value; */ return simcall_mc_random(min, max); } @@ -154,16 +153,19 @@ bool request_is_enabled(smx_simcall_t req) mutex = &temp_mutex; } #endif + if(mutex->owner == nullptr) return true; - else #if HAVE_MC + else if (mc_mode == MC_MODE_SERVER) { + simgrid::mc::Process& modelchecked = mc_model_checker->process(); // TODO, *(mutex->owner) :/ - return MC_smx_resolve_process(mutex->owner)->pid == - MC_smx_resolve_process(req->issuer)->pid; -#else - return mutex->owner->pid == req->issuer->pid; + return modelchecked.resolveProcess(simgrid::mc::remote(mutex->owner))->pid + == modelchecked.resolveProcess(simgrid::mc::remote(req->issuer))->pid; + } #endif + else + return mutex->owner->pid == req->issuer->pid; } default: