From ec4fa94c499ef2a6051ef5ca3fb5278ca0d219bd Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sun, 22 Oct 2017 15:13:14 +0200 Subject: [PATCH] Cosmetics. --- src/kernel/context/ContextBoost.cpp | 8 ++++---- src/kernel/context/ContextBoost.hpp | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index bf96864f7c..a9422e0d0c 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -177,7 +177,7 @@ void SerialBoostContext::suspend() XBT_DEBUG("No more process to run"); next_context = static_cast(BoostContext::getMaestro()); } - SIMIX_context_set_current(static_cast(next_context)); + SIMIX_context_set_current(next_context); BoostContext::swap(this, next_context); } @@ -225,12 +225,12 @@ void ParallelBoostContext::finalize() void ParallelBoostContext::run_all() { threads_working_ = 0; - if (not parmap_) + if (parmap_ == nullptr) parmap_ = new simgrid::xbt::Parmap(SIMIX_context_get_nthreads(), SIMIX_context_get_parallel_mode()); parmap_->apply( [](smx_actor_t process) { ParallelBoostContext* context = static_cast(process->context); - return context->resume(); + context->resume(); }, simix_global->process_to_run); } @@ -258,7 +258,7 @@ void ParallelBoostContext::resume() xbt_os_thread_set_specific(worker_id_key_, reinterpret_cast(worker_id)); ParallelBoostContext* worker_context = static_cast(SIMIX_context_self()); - workers_context_[worker_id] = worker_context; + workers_context_[worker_id] = worker_context; SIMIX_context_set_current(this); BoostContext::swap(worker_context, this); diff --git a/src/kernel/context/ContextBoost.hpp b/src/kernel/context/ContextBoost.hpp index a067e8adf9..1132f9860f 100644 --- a/src/kernel/context/ContextBoost.hpp +++ b/src/kernel/context/ContextBoost.hpp @@ -105,13 +105,12 @@ class BoostContextFactory : public ContextFactory { public: BoostContextFactory(); ~BoostContextFactory() override; - Context* create_context(std::function code, void_pfn_smxprocess_t, smx_actor_t process) override; + Context* create_context(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process) override; void run_all() override; private: bool parallel_; }; - }}} // namespace #endif -- 2.20.1