static_cast<BoostContext**>(arg.data)[0]->fc_ = arg.fctx;
BoostContext* context = static_cast<BoostContext**>(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)
void BoostSerialContext::stop()
{
BoostContext::stop();
- this->suspend();
+ throw StopRequest();
}
// BoostParallelContext
void BoostParallelContext::stop()
{
BoostContext::stop();
- this->suspend();
+ throw StopRequest();
}
void BoostParallelContext::resume()