- smx_simcall_t req = &actor->simcall;
-
- switch (req->call) {
- case SIMCALL_NONE:
- return false;
-
- case SIMCALL_COMM_WAIT: {
- /* FIXME: check also that src and dst processes are not suspended */
- simgrid::kernel::activity::CommImpl* act =
- static_cast<simgrid::kernel::activity::CommImpl*>(simcall_comm_wait__getraw__comm(req));
-
- if (act->src_timeout || act->dst_timeout) {
- /* If it has a timeout it will be always be enabled (regardless of who declared the timeout),
- * because even if the communication is not ready, it can timeout and won't block. */
- if (_sg_mc_timeout == 1)
- return true;
- }
- /* On the other hand if it hasn't a timeout, check if the comm is ready.*/
- else if (act->detached && act->src_proc == nullptr && act->type == SIMIX_COMM_READY)
- return (act->dst_proc != nullptr);
- return (act->src_proc && act->dst_proc);
- }
-
- case SIMCALL_COMM_WAITANY: {
- xbt_dynar_t comms = simcall_comm_waitany__get__comms(req);
- for (unsigned int index = 0; index < comms->used; ++index) {
- simgrid::kernel::activity::CommImpl* act = xbt_dynar_get_as(comms, index, simgrid::kernel::activity::CommImpl*);
- if (act->src_proc && act->dst_proc)
- return true;
- }
- return false;
- }
-
- case SIMCALL_MUTEX_LOCK: {
- smx_mutex_t mutex = simcall_mutex_lock__get__mutex(req);
-
- if (mutex->owner == nullptr)
- return true;
- return mutex->owner->pid_ == req->issuer->pid_;
- }
-
- case SIMCALL_SEM_ACQUIRE: {
- static int warned = 0;
- if (not warned)
- XBT_INFO("Using semaphore in model-checked code is still experimental. Use at your own risk");
- warned = 1;
- return true;
- }