Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "Give back control to maestro as late as possible."
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 20 Jul 2017 09:56:07 +0000 (11:56 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 20 Jul 2017 09:56:07 +0000 (11:56 +0200)
This reverts commit c7829c256a041aae9a60454263de30188b3f2fcc.

Tests are failing on Travis, and build faild on Appveyor :-(

include/xbt/xbt_os_thread.h
src/kernel/context/ContextThread.cpp

index e73022d..fa4c014 100644 (file)
@@ -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);
index 012fbcc..85ac35a 100644 (file)
@@ -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()