X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/95bcda88a7fcfa168381cba0eedadb1e4937d0b3..dee660d3d8723212a477dc4eb393b548f06a5f84:/src/mc/mc_base.c diff --git a/src/mc/mc_base.c b/src/mc/mc_base.c index 20d8f436ad..e3717efad2 100644 --- a/src/mc/mc_base.c +++ b/src/mc/mc_base.c @@ -92,6 +92,23 @@ int MC_request_is_enabled(smx_simcall_t req) } return FALSE; + case SIMCALL_MUTEX_LOCK: { + smx_mutex_t mutex = simcall_mutex_lock__get__mutex(req); +#ifdef HAVE_MC + s_smx_mutex_t temp_mutex; + if (!MC_process_is_self(&mc_model_checker->process)) { + MC_process_read(&mc_model_checker->process, MC_PROCESS_NO_FLAG, + &temp_mutex, mutex, sizeof(temp_mutex), + MC_PROCESS_INDEX_ANY); + mutex = &temp_mutex; + } +#endif + if(mutex->owner == NULL) + return TRUE; + else + return (mutex->owner->pid == req->issuer->pid); + } + default: /* The rest of the requests are always enabled */ return TRUE; @@ -107,6 +124,7 @@ int MC_request_is_visible(smx_simcall_t req) || req->call == SIMCALL_COMM_TEST || req->call == SIMCALL_COMM_TESTANY || req->call == SIMCALL_MC_RANDOM + || req->call == SIMCALL_MUTEX_LOCK #ifdef HAVE_MC || req->call == SIMCALL_MC_SNAPSHOT || req->call == SIMCALL_MC_COMPARE_SNAPSHOTS