Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix maestro-set
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 29 Aug 2018 21:11:37 +0000 (23:11 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 29 Aug 2018 21:11:37 +0000 (23:11 +0200)
src/kernel/context/ContextThread.cpp

index be6f65d..15a9ef7 100644 (file)
@@ -118,12 +118,13 @@ void *ThreadContext::wrapper(void *param)
     (*context)();
   } catch (StopRequest const&) {
     XBT_DEBUG("Caught a StopRequest");
     (*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;
   }
   } 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();
 
   // Signal to the caller (normally the maestro) that we have finished:
   context->yield();