From: Frederic Suter Date: Thu, 20 Jul 2017 09:59:42 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_17~345 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b81fbca63e1c91d6c0084ed124988e4bbbf6d56b?hp=b69249bc70fa79e87f2ff6dad05147480b1812e7 Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/include/xbt/xbt_os_thread.h b/include/xbt/xbt_os_thread.h index e73022d140..fa4c014184 100644 --- a/include/xbt/xbt_os_thread.h +++ b/include/xbt/xbt_os_thread.h @@ -31,8 +31,6 @@ typedef struct xbt_os_thread_ *xbt_os_thread_t; XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_create(const char *name, pvoid_f_pvoid_t start_routine, void *param, void *data); XBT_PUBLIC(void) xbt_os_thread_exit(int *retcode); XBT_PUBLIC(void) xbt_os_thread_detach(xbt_os_thread_t thread); -#define xbt_os_thread_cleanup_push(routine, arg) pthread_cleanup_push(routine, arg) -#define xbt_os_thread_cleanup_pop(execute) pthread_cleanup_pop(execute) XBT_PUBLIC(xbt_os_thread_t) xbt_os_thread_self(void); XBT_PUBLIC(const char *) xbt_os_thread_self_name(void); diff --git a/src/kernel/context/ContextThread.cpp b/src/kernel/context/ContextThread.cpp index 012fbcc7ce..85ac35a62a 100644 --- a/src/kernel/context/ContextThread.cpp +++ b/src/kernel/context/ContextThread.cpp @@ -200,9 +200,9 @@ void ThreadContext::stop() xbt_os_sem_release(smx_ctx_thread_sem); // Signal to the maestro that it has finished: - xbt_os_thread_cleanup_push((void (*)(void*))xbt_os_sem_release, this->end_); + xbt_os_sem_release(this->end_); + xbt_os_thread_exit(nullptr); - xbt_os_thread_cleanup_pop(0); } void ThreadContext::suspend()