X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fa0bb7e4203ef24f51ea4f8d1a8abe376e4885d5..82567f27fa74ddc2b6afa8d9b682bdde15fe3f9c:/src/kernel/context/ContextThread.cpp diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index 7914f29e76..3e2b0668bd 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -158,7 +158,7 @@ void ThreadContext::suspend() void ThreadContext::attach_start() { // We're breaking the layers here by depending on the upper layer: - ThreadContext* maestro = (ThreadContext*)simix_global->maestro_process->context_; + ThreadContext* maestro = static_cast(simix_global->maestro_process->context_.get()); maestro->begin_.release(); xbt_assert(not this->is_maestro()); this->start(); @@ -169,7 +169,7 @@ void ThreadContext::attach_stop() xbt_assert(not this->is_maestro()); this->yield(); - ThreadContext* maestro = (ThreadContext*)simix_global->maestro_process->context_; + ThreadContext* maestro = static_cast(simix_global->maestro_process->context_.get()); maestro->end_.acquire(); Context::set_current(nullptr); @@ -181,7 +181,7 @@ void SerialThreadContext::run_all() { for (smx_actor_t const& actor : simix_global->actors_to_run) { XBT_DEBUG("Handling %p", actor); - ThreadContext* context = static_cast(actor->context_); + ThreadContext* context = static_cast(actor->context_.get()); context->release(); context->wait(); } @@ -205,9 +205,9 @@ void ParallelThreadContext::finalize() void ParallelThreadContext::run_all() { for (smx_actor_t const& actor : simix_global->actors_to_run) - static_cast(actor->context_)->release(); + static_cast(actor->context_.get())->release(); for (smx_actor_t const& actor : simix_global->actors_to_run) - static_cast(actor->context_)->wait(); + static_cast(actor->context_.get())->wait(); } void ParallelThreadContext::start_hook()