}
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 {
void SerialUContext::stop()
{
Context::stop();
- this->suspend();
+ throw StopRequest();
}
void SerialUContext::suspend()
void ParallelUContext::stop()
{
UContext::stop();
- this->suspend();
+ throw StopRequest();
}
/** Run one particular simulated process on the current thread. */