X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f5792a3bf76ce15a573ae5e9c63097595ae5f2bd..d185bae25f7b17fd34cdea9b4f038a021b6f526d:/src/kernel/context/ContextRaw.cpp diff --git a/src/kernel/context/ContextRaw.cpp b/src/kernel/context/ContextRaw.cpp index 53726aa300..244fdd448a 100644 --- a/src/kernel/context/ContextRaw.cpp +++ b/src/kernel/context/ContextRaw.cpp @@ -291,8 +291,13 @@ RawContext* RawContextFactory::create_context(std::function code, void RawContext::wrapper(void* arg) { RawContext* context = static_cast(arg); - (*context)(); - context->stop(); + try { + (*context)(); + context->Context::stop(); + } catch (StopRequest const&) { + XBT_DEBUG("Caught a StopRequest"); + } + context->suspend(); } RawContext::RawContext(std::function code, @@ -323,7 +328,7 @@ RawContext::~RawContext() void RawContext::stop() { Context::stop(); - this->suspend(); + throw StopRequest(); } void RawContextFactory::run_all()