X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3143f7c9b211373e47e43221a4587a253fc449df..7b7b18bf76328764ba08d088f0b589c2737ffe36:/src/kernel/context/ContextBoost.cpp diff --git a/src/kernel/context/ContextBoost.cpp b/src/kernel/context/ContextBoost.cpp index f39f1d5213..a4c78b34e0 100644 --- a/src/kernel/context/ContextBoost.cpp +++ b/src/kernel/context/ContextBoost.cpp @@ -135,8 +135,13 @@ void BoostContext::smx_ctx_boost_wrapper(BoostContext::ctx_arg_type arg) static_cast(arg.data)[0]->fc_ = arg.fctx; BoostContext* context = static_cast(arg.data)[1]; #endif - (*context)(); - context->stop(); + try { + (*context)(); + context->stop(); + } catch (StopRequest) { + XBT_DEBUG("Caught a StopRequest"); + } + context->suspend(); } inline void BoostContext::smx_ctx_boost_jump_fcontext(BoostContext* from, BoostContext* to) @@ -223,7 +228,7 @@ void BoostSerialContext::suspend() void BoostSerialContext::stop() { BoostContext::stop(); - this->suspend(); + throw StopRequest(); } // BoostParallelContext @@ -250,7 +255,7 @@ void BoostParallelContext::suspend() void BoostParallelContext::stop() { BoostContext::stop(); - this->suspend(); + throw StopRequest(); } void BoostParallelContext::resume()