Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Stupid me !
[simgrid.git] / src / xbt / context.c
index 4f57bc7..f5af18b 100644 (file)
@@ -102,6 +102,7 @@ static void *__context_wrapper(void *c)
   int i;
 
 #ifdef USE_PTHREADS
+  pthread_mutex_lock(&(context->mutex));
   pthread_cond_wait(&(context->cond), &(context->mutex));
   pthread_mutex_unlock(&(context->mutex));
 #endif
@@ -130,7 +131,7 @@ static void *__context_wrapper(void *c)
 /** \name Functions 
  *  \ingroup XBT_context
  */
-/*@{*/
+/* @{ */
 /** Context module initialization
  *
  * \warning It has to be called before using any other function of this module.
@@ -167,8 +168,6 @@ void xbt_context_empty_trash(void)
 void xbt_context_start(xbt_context_t context) 
 {
 #ifdef USE_PTHREADS
-  pthread_mutex_lock(&(context->mutex));
-
   /* Launch the thread */
   xbt_assert0(!pthread_create(context->thread, NULL, __context_wrapper, context),
              "Unable to create a thread.");
@@ -289,5 +288,4 @@ void xbt_context_free(xbt_context_t context)
 
   return;
 }
-
-/*@}*/
+/* @} */