From 683655bd1b0f7fcead15bcfa65c482dab060b1ce Mon Sep 17 00:00:00 2001 From: Christian Heinrich Date: Fri, 12 Jan 2018 14:48:11 +0100 Subject: [PATCH] [SIMIX] Fix the ActorImpl signal The signal was fired too early, so I moved it to another position. --- src/simix/ActorImpl.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index fcc6dac696..f04292c67d 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -314,8 +314,6 @@ smx_actor_t SIMIX_process_create(const char* name, std::function code, v } smx_actor_t process = new simgrid::simix::ActorImpl(); - simgrid::s4u::ActorPtr tmp = process->iface(); // Passing this directly to onCreation will lead to crashes - simgrid::s4u::Actor::onCreation(tmp); xbt_assert(code && host != nullptr, "Invalid parameters"); /* Process data */ @@ -366,6 +364,12 @@ smx_actor_t SIMIX_process_create(const char* name, std::function code, v /* Tracing the process creation */ TRACE_msg_process_create(process->getName(), process->pid, process->host); + /* Note by cheinrich: If you move this directly after the "new ActorImpl", the pid + * will not yet be set and you will cause issues when other code relies on that. + * This is of course also true for the other properties, so I moved this here. + */ + simgrid::s4u::ActorPtr tmp = process->iface(); // Passing this directly to onCreation will lead to crashes + simgrid::s4u::Actor::onCreation(tmp); return process; } -- 2.20.1