Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't use %t in log format, but %P; revalidate the output after listener introduction
[simgrid.git] / src / xbt / xbt_os_thread.c
index dad3c66..f34821d 100644 (file)
@@ -72,6 +72,9 @@ void xbt_os_thread_mod_init(void) {
    main_thread->exception = xbt_new(ex_ctx_t, 1);
    XBT_CTX_INITIALIZE(main_thread->exception);
 
+   __xbt_ex_ctx = _os_thread_ex_ctx;
+   __xbt_ex_terminate = _os_thread_ex_terminate;
+
    thread_mod_inited = 1;
 }
 void xbt_os_thread_mod_exit(void) {
@@ -238,6 +241,8 @@ void xbt_os_cond_timedwait(xbt_os_cond_t cond, xbt_os_mutex_t mutex, double dela
    ts_end.tv_nsec = (long)  ( ( end - ts_end.tv_sec) * 1000000000);
    DEBUG3("pthread_cond_timedwait(%p,%p,%p)",&(cond->c),&(mutex->m), &ts_end);
    switch ( (errcode=pthread_cond_timedwait(&(cond->c),&(mutex->m), &ts_end)) ) {
+    case 0:
+      return;
     case ETIMEDOUT:
      THROW3(timeout_error,errcode,"condition %p (mutex %p) wasn't signaled before timeout (%f)",
            cond,mutex, delay);