From 5b6023822fdeec6470f9da22aa35be032e6b9ae0 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 29 Aug 2018 23:11:37 +0200 Subject: [PATCH] fix maestro-set --- src/kernel/context/ContextThread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index be6f65ddcb..15a9ef7fc0 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -118,12 +118,13 @@ void *ThreadContext::wrapper(void *param) (*context)(); } catch (StopRequest const&) { XBT_DEBUG("Caught a StopRequest"); - xbt_assert(not context->is_maestro(), "I'm not supposed to be maestro here."); + xbt_assert(not context->is_maestro(), "Maestro shall not receive StopRequests, even when detached."); } catch (simgrid::Exception const& e) { XBT_INFO("Actor killed by an uncatched exception %s", simgrid::xbt::demangle(typeid(e).name()).get()); throw; } - context->Context::stop(); + if (not context->is_maestro()) // Just in case somebody detached maestro + context->Context::stop(); // Signal to the caller (normally the maestro) that we have finished: context->yield(); -- 2.20.1