X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3143f7c9b211373e47e43221a4587a253fc449df..7b7b18bf7:/src/kernel/context/ContextUnix.cpp diff --git a/src/kernel/context/ContextUnix.cpp b/src/kernel/context/ContextUnix.cpp index ec26e437ce..5a7148d2de 100644 --- a/src/kernel/context/ContextUnix.cpp +++ b/src/kernel/context/ContextUnix.cpp @@ -247,8 +247,13 @@ static void smx_ctx_sysv_wrapper(int first, ...) } memcpy(&context, ctx_addr, sizeof(simgrid::kernel::context::UContext*)); - (*context)(); - context->stop(); + try { + (*context)(); + context->stop(); + } catch (simgrid::kernel::context::Context::StopRequest) { + XBT_DEBUG("Caught a StopRequest"); + } + context->suspend(); } namespace simgrid { @@ -258,7 +263,7 @@ namespace context { void SerialUContext::stop() { Context::stop(); - this->suspend(); + throw StopRequest(); } void SerialUContext::suspend() @@ -291,7 +296,7 @@ void SerialUContext::resume() void ParallelUContext::stop() { UContext::stop(); - this->suspend(); + throw StopRequest(); } /** Run one particular simulated process on the current thread. */