Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Only initialize the mutex&condition used for context creation when using the pthreads...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 16 Mar 2007 10:42:58 +0000 (10:42 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 16 Mar 2007 10:42:58 +0000 (10:42 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3288 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/context.c

index f80d0d8..c732042 100644 (file)
@@ -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);
                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();
                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 ;
        xbt_swag_free(context_living);
        
        init_context = current_context = NULL ;
+#ifdef CONTEXT_THREADS    
        xbt_mutex_destroy(creation_mutex);
        xbt_mutex_destroy(creation_mutex);
-       xbt_thcond_destroy(creation_cond);   
+       xbt_thcond_destroy(creation_cond);
+#endif   
 }
 
 /** 
 }
 
 /**