Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix a race condition in SwappedCtx parallel exec
[simgrid.git] / src / kernel / context / ContextRaw.cpp
index f6eaf31..3b29062 100644 (file)
@@ -200,13 +200,12 @@ RawContext::RawContext(std::function<void()> code, void_pfn_smxprocess_t cleanup
 {
    if (has_code()) {
 #if PTH_STACKGROWTH == -1
-     ASAN_ONLY(this->asan_stack_ = static_cast<char*>(this->stack_) + smx_context_usable_stack_size);
+     ASAN_ONLY(this->asan_stack_ = static_cast<char*>(get_stack()) + smx_context_usable_stack_size);
 #else
-     ASAN_ONLY(this->asan_stack_ = this->stack_);
+     ASAN_ONLY(this->asan_stack_ = get_stack());
 #endif
-     this->stack_top_ = raw_makecontext(this->stack_, smx_context_usable_stack_size, RawContext::wrapper, this);
+     this->stack_top_ = raw_makecontext(get_stack(), smx_context_usable_stack_size, RawContext::wrapper, this);
    } else {
-     set_maestro(this); // save maestro for run_all()
      if (MC_is_active())
        MC_ignore_heap(&stack_top_, sizeof(stack_top_));
    }