- } catch (StopRequest const&) {
- XBT_DEBUG("Caught a StopRequest");
- xbt_assert(not context->is_maestro(), "Maestro shall not receive StopRequests, even when detached.");
+ if (not context->is_maestro()) { // Just in case somebody detached maestro
+ context->Context::stop();
+ context->stop_hook();
+ }
+ } 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.");