X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d7fb52aa1f18cd70a51a6d8913c1a4513fea7ce7..4d02714ee138a3bd9b02e0064b7a2aa26407e9e8:/src/kernel/context/ContextRaw.cpp diff --git a/src/kernel/context/ContextRaw.cpp b/src/kernel/context/ContextRaw.cpp index 3b2906237b..2f0165fc4c 100644 --- a/src/kernel/context/ContextRaw.cpp +++ b/src/kernel/context/ContextRaw.cpp @@ -186,24 +186,17 @@ namespace context { // RawContextFactory -Context* RawContextFactory::create_context(std::function code, void_pfn_smxprocess_t cleanup_func, - smx_actor_t process) +Context* RawContextFactory::create_context(std::function code, smx_actor_t actor) { - return this->new_context(std::move(code), cleanup_func, process, this); + return this->new_context(std::move(code), actor, this); } // RawContext -RawContext::RawContext(std::function code, void_pfn_smxprocess_t cleanup, smx_actor_t process, - SwappedContextFactory* factory) - : SwappedContext(std::move(code), cleanup, process, factory) +RawContext::RawContext(std::function code, smx_actor_t actor, SwappedContextFactory* factory) + : SwappedContext(std::move(code), actor, factory) { if (has_code()) { -#if PTH_STACKGROWTH == -1 - ASAN_ONLY(this->asan_stack_ = static_cast(get_stack()) + smx_context_usable_stack_size); -#else - ASAN_ONLY(this->asan_stack_ = get_stack()); -#endif this->stack_top_ = raw_makecontext(get_stack(), smx_context_usable_stack_size, RawContext::wrapper, this); } else { if (MC_is_active()) @@ -217,14 +210,13 @@ void RawContext::wrapper(void* arg) ASAN_FINISH_SWITCH(nullptr, &context->asan_ctx_->asan_stack_, &context->asan_ctx_->asan_stack_size_); try { (*context)(); - } catch (StopRequest const&) { - XBT_DEBUG("Caught a StopRequest"); + context->Context::stop(); + } catch (ForcefulKillException const&) { + XBT_DEBUG("Caught a ForcefulKillException"); } catch (simgrid::Exception const& e) { XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get()); throw; } - context->Context::stop(); - ASAN_ONLY(context->asan_stop_ = true); context->suspend(); }