Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
factorize where seq_runall and par_runall save maestro context
[simgrid.git] / src / kernel / context / ContextBoost.cpp
index 9ae90ca..050267c 100644 (file)
@@ -43,12 +43,12 @@ BoostContext::BoostContext(std::function<void()> code, void_pfn_smxprocess_t cle
 #else
     this->fc_ = boost::context::detail::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper);
 #endif
+
   } else {
+    set_maestro(this); // save maestro for run_all()
 #if BOOST_VERSION < 105600
     this->fc_ = new boost::context::fcontext_t();
 #endif
-    if (get_maestro() == nullptr)
-      set_maestro(this);
   }
 }