Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
xbt_thread_join() function is now implemented
authorcherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 14 Mar 2007 21:25:34 +0000 (21:25 +0000)
committercherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 14 Mar 2007 21:25:34 +0000 (21:25 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3274 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/context.c

index 4289178..9b3dd11 100644 (file)
@@ -14,7 +14,7 @@
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 #include "xbt/xbt_thread.h"
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 #include "xbt/xbt_thread.h"
-#include <pthread.h> // I need pthread_join that is not yet available in xbt_thread.
+/*#include <pthread.h>*/ /* I need pthread_join that is not yet available in xbt_thread.*/
 
 #ifdef CONTEXT_THREADS
  /* This file (context.c) is only loaded in libsimgrid, not libgras.
 
 #ifdef CONTEXT_THREADS
  /* This file (context.c) is only loaded in libsimgrid, not libgras.
@@ -107,8 +107,10 @@ static void xbt_context_free(xbt_context_t context)
        if (!context) return;
        DEBUG1("Freeing %p",context);
 #ifdef CONTEXT_THREADS
        if (!context) return;
        DEBUG1("Freeing %p",context);
 #ifdef CONTEXT_THREADS
-       DEBUG1("\t joining %p",(void *)context->thread->t);
-       pthread_join(context->thread->t,NULL);
+       /*DEBUG1("\t joining %p",(void *)context->thread->t);*/
+       DEBUG1("\t joining %p",(void *)context->thread);
+       /*pthread_join(context->thread->t,NULL);*/
+       xbt_thread_join(context->thread,NULL);
        DEBUG1("\t xbt_free %p",(void *)context->thread);
        xbt_free(context->thread);
        DEBUG1("\t mutex_destroy %p",(void *)context->mutex);
        DEBUG1("\t xbt_free %p",(void *)context->thread);
        xbt_free(context->thread);
        DEBUG1("\t mutex_destroy %p",(void *)context->mutex);