void_pfn_smxprocess_t cleanup_func,
smx_actor_t process)
: BoostContext(std::move(code), cleanup_func, process) {}
- void stop() override;
void suspend() override;
};
void_pfn_smxprocess_t cleanup_func,
smx_actor_t process)
: BoostContext(std::move(code), cleanup_func, process) {}
- void stop() override;
void suspend() override;
void resume() override;
};
#endif
try {
(*context)();
- context->stop();
- } catch (const StopRequest&) {
+ context->Context::stop();
+ } catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
}
context->suspend();
// BoostSerialContext
+void BoostContext::stop()
+{
+ Context::stop();
+ throw StopRequest();
+}
+
void BoostContext::resume()
{
SIMIX_context_set_current(this);
smx_ctx_boost_jump_fcontext(this, next_context);
}
-void BoostSerialContext::stop()
-{
- BoostContext::stop();
- throw StopRequest();
-}
-
// BoostParallelContext
#if HAVE_THREAD_CONTEXTS
smx_ctx_boost_jump_fcontext(this, next_context);
}
-void BoostParallelContext::stop()
-{
- BoostContext::stop();
- throw StopRequest();
-}
-
void BoostParallelContext::resume()
{
uintptr_t worker_id = __sync_fetch_and_add(&threads_working_, 1);
void_pfn_smxprocess_t cleanup_func,
smx_actor_t process);
~BoostContext() override;
+ void stop() override;
virtual void resume();
private:
static void wrapper(int first, ...);
RawContext* context = static_cast<RawContext*>(arg);
try {
(*context)();
- context->stop();
- } catch (StopRequest) {
+ context->Context::stop();
+ } catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
}
context->suspend();
try {
(*context)();
- context->stop();
- } catch (StopRequest) {
+ context->Context::stop();
+ } catch (StopRequest const&) {
XBT_DEBUG("Caught a StopRequest");
}
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()
{