From: alegrand Date: Tue, 1 Mar 2005 06:08:52 +0000 (+0000) Subject: more debuging X-Git-Tag: v3.3~4229 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3de9bd297b49c6d0b62a18b21aef156da297dea7?ds=inline more debuging git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1124 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/context.c b/src/xbt/context.c index fce1e64c3c..bc16f82279 100644 --- a/src/xbt/context.c +++ b/src/xbt/context.c @@ -108,9 +108,13 @@ static void *__context_wrapper(void *c) int i; #ifdef USE_PTHREADS + DEBUG0("**** Lock ****"); pthread_mutex_lock(&(context->mutex)); + DEBUG0("**** Releasing the prisonner ****"); pthread_cond_signal(&(context->cond)); + DEBUG0("**** Going to Jail ****"); pthread_cond_wait(&(context->cond), &(context->mutex)); + DEBUG0("**** Unlocking ****"); pthread_mutex_unlock(&(context->mutex)); #endif @@ -176,10 +180,14 @@ void xbt_context_start(xbt_context_t context) { #ifdef USE_PTHREADS /* Launch the thread */ + DEBUG0("**** Locking ****"); pthread_mutex_lock(&(context->mutex)); + DEBUG0("**** Pthread create ****"); xbt_assert0(!pthread_create(context->thread, NULL, __context_wrapper, context), "Unable to create a thread."); + DEBUG0("**** Going to jail ****"); pthread_cond_wait(&(context->cond), &(context->mutex)); + DEBUG0("**** Unlocking ****"); pthread_mutex_unlock(&(context->mutex)); #else makecontext (&(context->uc), (void (*) (void)) __context_wrapper,