Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fail loudly when someone tries to use Actor::join() in MC (not implemented)
[simgrid.git] / src / s4u / s4u_Actor.cpp
index 27b2dca..372470b 100644 (file)
@@ -108,6 +108,9 @@ void Actor::join() const
 
 void Actor::join(double timeout) const
 {
+  xbt_assert(not(MC_is_active() || MC_record_replay_is_active()),
+             "Actor::join() is not usable in MC yet. Please report this bug.");
+
   kernel::actor::ActorImpl* issuer = kernel::actor::ActorImpl::self();
   const kernel::actor::ActorImpl* target = pimpl_;
   kernel::actor::simcall_blocking([issuer, target, timeout] {
@@ -250,7 +253,7 @@ void Actor::kill()
 
 ActorPtr Actor::by_pid(aid_t pid)
 {
-  kernel::actor::ActorImpl* actor = kernel::actor::ActorImpl::by_pid(pid);
+  kernel::actor::ActorImpl* actor = kernel::EngineImpl::get_instance()->get_actor_by_pid(pid);
   if (actor != nullptr)
     return actor->get_iface();
   else
@@ -720,7 +723,7 @@ sg_actor_t sg_actor_attach(const char* name, void* data, sg_host_t host, xbt_dic
   xbt_dict_free(&properties);
 
   /* Let's create the actor: SIMIX may decide to start it right now, even before returning the flow control to us */
-  smx_actor_t actor = nullptr;
+  simgrid::kernel::actor::ActorImpl* actor = nullptr;
   try {
     actor = simgrid::kernel::actor::ActorImpl::attach(name, data, host).get();
     actor->set_properties(props);