From: mquinson Date: Fri, 16 Mar 2007 10:42:58 +0000 (+0000) Subject: Only initialize the mutex&condition used for context creation when using the pthreads... X-Git-Tag: v3.3~2071 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/11819220e15518f0aacff177da8655da0a9f9826 Only initialize the mutex&condition used for context creation when using the pthreads to implement the xbt_contextes git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3288 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/context.c b/src/xbt/context.c index f80d0d812b..c732042694 100644 --- a/src/xbt/context.c +++ b/src/xbt/context.c @@ -248,8 +248,10 @@ void xbt_context_init(void) context_to_destroy = xbt_swag_new(xbt_swag_offset(*current_context,hookup)); context_living = xbt_swag_new(xbt_swag_offset(*current_context,hookup)); xbt_swag_insert(init_context, context_living); +#ifdef CONTEXT_THREADS creation_mutex = xbt_mutex_init(); creation_cond = xbt_thcond_init(); +#endif } } @@ -388,8 +390,10 @@ void xbt_context_exit(void) { xbt_swag_free(context_living); init_context = current_context = NULL ; +#ifdef CONTEXT_THREADS xbt_mutex_destroy(creation_mutex); - xbt_thcond_destroy(creation_cond); + xbt_thcond_destroy(creation_cond); +#endif } /**