X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cb5f454f56e825bc82b74dd65b22a395ac754064..d0d1912b2262e2aaf06b39115de5f846e2a86efe:/src/kernel/context/ContextThread.cpp diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index 2a3b815f8c..7b25fc6d9c 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -7,6 +7,7 @@ #include "simgrid/Exception.hpp" #include "src/internal_config.h" /* loads context system definitions */ +#include "src/kernel/EngineImpl.hpp" #include "src/simix/smx_private.hpp" #include "xbt/function_types.h" #include "xbt/xbt_modinter.h" /* prototype of os thread module's init/exit in XBT */ @@ -177,7 +178,8 @@ void ThreadContext::attach_stop() void SerialThreadContext::run_all() { - for (smx_actor_t const& actor : simix_global->actors_to_run) { + const auto& to_run = EngineImpl::get_instance()->get_actors_to_run(); + for (smx_actor_t const& actor : to_run) { XBT_DEBUG("Handling %p", actor); auto* context = static_cast(actor->context_.get()); context->release(); @@ -202,9 +204,11 @@ void ParallelThreadContext::finalize() void ParallelThreadContext::run_all() { - for (smx_actor_t const& actor : simix_global->actors_to_run) + const auto& to_release = EngineImpl::get_instance()->get_actors_to_run(); + for (smx_actor_t const& actor : to_release) static_cast(actor->context_.get())->release(); - for (smx_actor_t const& actor : simix_global->actors_to_run) + const auto& to_wait = EngineImpl::get_instance()->get_actors_to_run(); + for (smx_actor_t const& actor : to_wait) static_cast(actor->context_.get())->wait(); }