X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c93f29cd7a1453e10d8635f11e48cf0d537a83a2..285721a10666864ff257d2709094ece7dcccc879:/src/kernel/context/ContextBoost.cpp?ds=sidebyside diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index 6a8beb7c37..46103930c6 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -29,10 +29,9 @@ namespace context { // BoostContextFactory BoostContextFactory::BoostContextFactory() - : ContextFactory("BoostContextFactory") + : ContextFactory("BoostContextFactory"), parallel_(SIMIX_context_is_parallel()) { - BoostContext::parallel_ = SIMIX_context_is_parallel(); - if (BoostContext::parallel_) { + if (parallel_) { #if HAVE_THREAD_CONTEXTS BoostContext::parmap_ = nullptr; BoostContext::workers_context_.clear(); @@ -58,7 +57,7 @@ smx_context_t BoostContextFactory::create_context(std::function code, vo smx_actor_t process) { #if HAVE_THREAD_CONTEXTS - if (BoostContext::parallel_) + if (parallel_) return this->new_context(std::move(code), cleanup_func, process); #endif @@ -68,7 +67,7 @@ smx_context_t BoostContextFactory::create_context(std::function code, vo void BoostContextFactory::run_all() { #if HAVE_THREAD_CONTEXTS - if (BoostContext::parallel_) { + if (parallel_) { BoostContext::threads_working_ = 0; if (not BoostContext::parmap_) BoostContext::parmap_ = @@ -94,7 +93,6 @@ void BoostContextFactory::run_all() // BoostContext -bool BoostContext::parallel_ = false; simgrid::xbt::Parmap* BoostContext::parmap_ = nullptr; uintptr_t BoostContext::threads_working_ = 0; xbt_os_thread_key_t BoostContext::worker_id_key_;