Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
plug a memleak
[simgrid.git] / src / xbt / xbt_thread.c
index 7da3252..6a821ce 100644 (file)
@@ -79,6 +79,7 @@ xbt_thread_join(xbt_thread_t thread,void ** thread_return) {
        
        if ((errcode = pthread_join(thread->t,thread_return)))
                THROW0(system_error,errcode, "pthread_join failed");
        
        if ((errcode = pthread_join(thread->t,thread_return)))
                THROW0(system_error,errcode, "pthread_join failed");
+       free(thread);   
 }                     
 
 void xbt_thread_exit(int *retval) {
 }                     
 
 void xbt_thread_exit(int *retval) {
@@ -388,7 +389,7 @@ void xbt_thcond_signal(xbt_thcond_t cond) {
      if(!SetEvent(cond->events[SIGNAL]))
        THROW0(system_error,0,"SetEvent failed");
        
      if(!SetEvent(cond->events[SIGNAL]))
        THROW0(system_error,0,"SetEvent failed");
        
-   Sleep(0);
+   xbt_thread_yield();
 }
 
 void xbt_thcond_broadcast(xbt_thcond_t cond){
 }
 
 void xbt_thcond_broadcast(xbt_thcond_t cond){