UContext(std::function<void()> code,
void_pfn_smxprocess_t cleanup_func, smx_actor_t process);
~UContext() override;
+ void stop() override;
};
class SerialUContext : public UContext {
void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
: UContext(std::move(code), cleanup_func, process)
{}
- void stop() override;
void suspend() override;
void resume();
};
void_pfn_smxprocess_t cleanup_func, smx_actor_t process)
: UContext(std::move(code), cleanup_func, process)
{}
- void stop() override;
void suspend() override;
void resume();
};
SIMIX_context_stack_delete(this->stack_);
}
+void UContext::stop()
+{
+ Context::stop();
+ throw StopRequest();
+}
}}} // namespace simgrid::kernel::context
static void smx_ctx_sysv_wrapper(int first, ...)
try {
(*context)();
- context->stop();
- } catch (simgrid::kernel::context::Context::StopRequest) {
+ context->Context::stop();
+ } catch (simgrid::kernel::context::Context::StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
}
context->suspend();
namespace kernel {
namespace context {
-void SerialUContext::stop()
-{
- Context::stop();
- throw StopRequest();
-}
-
void SerialUContext::suspend()
{
/* determine the next context */
swapcontext(&static_cast<SerialUContext*>(sysv_maestro_context)->uc_, &this->uc_);
}
-void ParallelUContext::stop()
-{
- UContext::stop();
- throw StopRequest();
-}
-
/** Run one particular simulated process on the current thread. */
void ParallelUContext::resume()
{