#include "portable.h"
#include "context_private.h"
-#include "xbt/error.h"
+#include "xbt/log.h"
#include "xbt/dynar.h"
#include "gras_config.h"
static void __xbt_context_yield(xbt_context_t context)
{
- int return_value = 0;
-
xbt_assert0(current_context,"You have to call context_init() first.");
DEBUG2("--------- current_context (%p) is yielding to context(%p) ---------",
VOIRP(context);
if(context) VOIRP(context->save);
if (context) {
+
+ int return_value = 0;
+
if(context->save==NULL) {
DEBUG0("**** Yielding to somebody else ****");
DEBUG2("Saving current_context value (%p) to context(%p)->save",current_context,context);
pthread_mutex_destroy(&(context->mutex));
pthread_cond_destroy(&(context->cond));
#endif
+ if(context->exception) free(context->exception);
free(context);
return;
}
}
/* callback: termination */
-static void __context_ex_terminate(ex_t *e)
+static void __context_ex_terminate(xbt_ex_t *e)
{
exit(e->value);
}
for(i=0;i<context->argc; i++)
if(context->argv[i]) free(context->argv[i]);
if(context->argv) free(context->argv);
- if(context->exception) free(context->exception);
if(context->cleanup_func)
context->cleanup_func(context->cleanup_arg);