- }
-
- case SIMCALL_MUTEX_LOCK: {
- smx_mutex_t mutex = simcall_mutex_lock__get__mutex(req);
-#if SIMGRID_HAVE_MC
- simgrid::mc::Remote<simgrid::simix::Mutex> temp_mutex;
- if (mc_model_checker != nullptr) {
- mc_model_checker->process().read(temp_mutex.getBuffer(), remote(mutex));
- mutex = temp_mutex.getBuffer();
- }
-#endif
-
- if(mutex->owner == nullptr)
- return true;
-#if SIMGRID_HAVE_MC
- else if (mc_model_checker != nullptr) {
- simgrid::mc::Process& modelchecked = mc_model_checker->process();
- // TODO, *(mutex->owner) :/
- return modelchecked.resolveActor(simgrid::mc::remote(mutex->owner))->pid ==
- modelchecked.resolveActor(simgrid::mc::remote(req->issuer))->pid;
- }
-#endif
- else
- return mutex->owner->pid == req->issuer->pid;
- }
-
- case SIMCALL_SEM_ACQUIRE: {
- static int warned = 0;
- if (!warned)
- XBT_INFO("Using semaphore in model-checked code is still experimental. Use at your own risk");
- warned = 1;
- return true;
- }
-
- case SIMCALL_COND_WAIT: {
- static int warned = 0;
- if (!warned)
- XBT_INFO("Using condition variables in model-checked code is still experimental. Use at your own risk");
- warned = 1;
- return true;
- }
-
- default:
- /* The rest of the requests are always enabled */
- return true;
- }
-}
-
-bool request_is_visible(smx_simcall_t req)
-{
- return req->call == SIMCALL_COMM_ISEND
- || req->call == SIMCALL_COMM_IRECV
- || req->call == SIMCALL_COMM_WAIT
- || req->call == SIMCALL_COMM_WAITANY
- || req->call == SIMCALL_COMM_TEST
- || req->call == SIMCALL_COMM_TESTANY
- || req->call == SIMCALL_MC_RANDOM
- || req->call == SIMCALL_MUTEX_LOCK
- || req->call == SIMCALL_MUTEX_TRYLOCK
- ;
-}
-
-}