#ifdef CONTEXT_THREADS
/*DEBUG1("\t joining %p",(void *)context->thread->t);*/
DEBUG1("\t joining %p",(void *)context->thread);
- /*pthread_join(context->thread->t,NULL);*/
+
xbt_thread_join(context->thread,NULL);
- DEBUG1("\t xbt_free %p",(void *)context->thread);
- xbt_free(context->thread);
+
DEBUG1("\t mutex_destroy %p",(void *)context->mutex);
xbt_mutex_destroy(context->mutex);
DEBUG1("\t cond_destroy %p",(void *)context->cond);
static void *
__context_wrapper(void* c) {
- xbt_context_t context = (xbt_context_t)c;
+ xbt_context_t context = current_context;
#ifdef CONTEXT_THREADS
+ context = (xbt_context_t)c;
context->thread = xbt_thread_self();
DEBUG3("**[ctx:%p;self:%p]** Lock creation_mutex %p ****",context,(void*)xbt_thread_self(), creation_mutex);