Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MC: checker kindly ask the app whether an actor is enabled instead of reading tons...
[simgrid.git] / src / mc / remote / RemoteClient.cpp
index 6046e09..f96e1e5 100644 (file)
@@ -673,5 +673,15 @@ void RemoteClient::dumpStack()
   unw_destroy_addr_space(as);
   return;
 }
+
+bool RemoteClient::actor_is_enabled(aid_t pid)
+{
+  s_mc_message_actor_enabled msg{MC_MESSAGE_ACTOR_ENABLED, pid};
+  process()->getChannel().send(msg);
+  char buff[MC_MESSAGE_LENGTH];
+  ssize_t received = process()->getChannel().receive(buff, MC_MESSAGE_LENGTH, true);
+  xbt_assert(received == sizeof(s_mc_message_int), "Unexpected size in answer to ACTOR_ENABLED");
+  return ((mc_message_int_t*)buff)->value;
+}
 }
 }