Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Move around code to be consistent with other context factories.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 22 Sep 2017 11:20:50 +0000 (13:20 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 22 Sep 2017 11:20:50 +0000 (13:20 +0200)
src/kernel/context/ContextThread.cpp

index 322d0e1..395e730 100644 (file)
@@ -158,6 +158,11 @@ void *ThreadContext::wrapper(void *param)
     XBT_DEBUG("Caught a StopRequest");
   }
 
     XBT_DEBUG("Caught a StopRequest");
   }
 
+  if (smx_ctx_thread_sem)
+    xbt_os_sem_release(smx_ctx_thread_sem);
+  // Signal to the maestro that it has finished:
+  xbt_os_sem_release(context->end_);
+
 #ifndef WIN32
   stack.ss_flags = SS_DISABLE;
   sigaltstack(&stack, nullptr);
 #ifndef WIN32
   stack.ss_flags = SS_DISABLE;
   sigaltstack(&stack, nullptr);
@@ -204,12 +209,6 @@ void ThreadContext::start()
 void ThreadContext::stop()
 {
   Context::stop();
 void ThreadContext::stop()
 {
   Context::stop();
-  if (smx_ctx_thread_sem)
-    xbt_os_sem_release(smx_ctx_thread_sem);
-
-  // Signal to the maestro that it has finished:
-  xbt_os_sem_release(this->end_);
-
   throw StopRequest();
 }
 
   throw StopRequest();
 }