- #ifdef USE_PTHREADS
- DEBUG0("**** Locking ****");
- pthread_mutex_lock(&(context->mutex));
- DEBUG0("**** Updating current_context ****");
- current_context = context;
- DEBUG0("**** Releasing the prisonner ****");
- pthread_cond_signal(&(context->cond));
- DEBUG0("**** Unlocking ****");
- pthread_mutex_unlock(&(context->mutex));
- DEBUG0("**** Exiting ****");
- pthread_exit(0);
- #elif defined(USE_WIN_THREADS)
- DEBUG0("**** Locking ****");
- win_thread_mutex_lock(&(context->mutex));
- DEBUG0("**** Updating current_context ****");
- current_context = context;
- DEBUG0("**** Releasing the prisonner ****");
- win_thread_cond_signal(&(context->cond));
- DEBUG0("**** Unlocking ****");
- win_thread_mutex_unlock(&(context->mutex));
- DEBUG0("**** Exiting ****");
- win_thread_exit(context->thread,0);
+ #ifdef CONTEXT_THREADS
+ DEBUG1("[%p] **** Locking ****", context);
+ xbt_mutex_lock(context->mutex);
+/* DEBUG1("[%p] **** Updating current_context ****"); */
+/* current_context = context; */
+ DEBUG1("[%p] **** Releasing the prisonner ****", context);
+ xbt_thcond_signal(context->cond);
+ DEBUG1("[%p] **** Unlocking ****", context);
+ xbt_mutex_unlock(context->mutex);
+ DEBUG1("[%p] **** Exiting ****", context);
+ xbt_thread_exit(NULL); // We should provide return value in case other wants it