X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/080e391e51390f2739098295d391680e05a6ca93..2d37e348a09783cda723c7019640ee69de168324:/src/kernel/context/ContextBoost.cpp diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index 56208f719c..6153c41878 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -23,9 +23,9 @@ smx_context_t BoostContextFactory::create_context(std::function code, vo // BoostContext -BoostContext::BoostContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t process, +BoostContext::BoostContext(std::function code, void_pfn_smxprocess_t cleanup_func, smx_actor_t actor, SwappedContextFactory* factory) - : SwappedContext(std::move(code), cleanup_func, process, factory) + : SwappedContext(std::move(code), cleanup_func, actor, factory) { /* if the user provided a function for the process then use it, otherwise it is the context for maestro */ @@ -37,7 +37,6 @@ BoostContext::BoostContext(std::function code, void_pfn_smxprocess_t cle #else void* stack = get_stack(); #endif - ASAN_ONLY(this->asan_stack_ = stack); #if BOOST_VERSION < 106100 this->fc_ = boost::context::make_fcontext(stack, smx_context_usable_stack_size, BoostContext::wrapper); #else @@ -45,7 +44,6 @@ BoostContext::BoostContext(std::function code, void_pfn_smxprocess_t cle #endif } else { - set_maestro(this); // save maestro for run_all() #if BOOST_VERSION < 105600 this->fc_ = new boost::context::fcontext_t(); #endif @@ -55,7 +53,7 @@ BoostContext::BoostContext(std::function code, void_pfn_smxprocess_t cle BoostContext::~BoostContext() { #if BOOST_VERSION < 105600 - if (not this->stack_) + if (not get_stack()) delete this->fc_; #endif } @@ -72,13 +70,13 @@ void BoostContext::wrapper(BoostContext::arg_type arg) #endif try { (*context)(); + context->Context::stop(); } catch (StopRequest const&) { XBT_DEBUG("Caught a StopRequest"); } 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(); }