From: Arnaud Giersch Date: Fri, 22 Sep 2017 11:20:50 +0000 (+0200) Subject: Move around code to be consistent with other context factories. X-Git-Tag: v3_17~85 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1a3d511f8da553b2639acecdf974281e55b35a0e?ds=sidebyside Move around code to be consistent with other context factories. --- diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index 322d0e1f77..395e730cdb 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -158,6 +158,11 @@ void *ThreadContext::wrapper(void *param) 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); @@ -204,12 +209,6 @@ void ThreadContext::start() 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(); }