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 / ContextRaw.cpp
index fe8243d..8d320a1 100644 (file)
@@ -206,17 +206,12 @@ RawContext::RawContext(std::function<void()> code, void_pfn_smxprocess_t cleanup
 #endif
      this->stack_top_ = raw_makecontext(this->stack_, smx_context_usable_stack_size, RawContext::wrapper, this);
    } else {
 #endif
      this->stack_top_ = raw_makecontext(this->stack_, smx_context_usable_stack_size, RawContext::wrapper, this);
    } else {
-     if (process != nullptr && get_maestro() == nullptr)
-       set_maestro(this);
-     if (MC_is_active()) {
-       XBT_ATTRIB_UNUSED RawContext* maestro = static_cast<RawContext*>(get_maestro());
-       MC_ignore_heap(&maestro->stack_top_, sizeof(maestro->stack_top_));
-     }
+     set_maestro(this); // save maestro for run_all()
+     if (MC_is_active())
+       MC_ignore_heap(&stack_top_, sizeof(stack_top_));
    }
 }
 
    }
 }
 
-RawContext::~RawContext() = default;
-
 void RawContext::wrapper(void* arg)
 {
   RawContext* context = static_cast<RawContext*>(arg);
 void RawContext::wrapper(void* arg)
 {
   RawContext* context = static_cast<RawContext*>(arg);