if (has_code()) {
/* create and start the actor */
this->thread_ = new std::thread(ThreadContext::wrapper, this);
- /* wait the starting of the newly created actor */
+ /* wait the start of the newly created actor */
this->end_.acquire();
}
try {
(*context)();
- if (not context->is_maestro()) { // Just in case somebody detached maestro
- context->Context::stop();
- context->stop_hook();
- }
+ if (not context->is_maestro()) // Just in case somebody detached maestro
+ context->stop();
} catch (ForcefulKillException const&) {
XBT_DEBUG("Caught a ForcefulKillException in Thread::wrapper");
xbt_assert(not context->is_maestro(), "Maestro shall not receive ForcefulKillExceptions, even when detached.");
this->end_.release();
}
-void ThreadContext::stop()
-{
- Context::stop();
- stop_hook();
- throw ForcefulKillException();
-}
-
void ThreadContext::suspend()
{
this->yield();