Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Simplify the Context::stop() and reduce duplication
[simgrid.git] / src / kernel / context / ContextThread.cpp
index 488e53f..f5a1f7a 100644 (file)
@@ -97,10 +97,8 @@ void ThreadContext::wrapper(ThreadContext* context)
 
   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.");
@@ -140,13 +138,6 @@ void ThreadContext::yield()
   this->end_.release();
 }
 
-void ThreadContext::stop()
-{
-  Context::stop();
-  stop_hook();
-  throw ForcefulKillException();
-}
-
 void ThreadContext::suspend()
 {
   this->yield();