X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/caffa65a64dc6c71dbd7ec60af00ec0da51073a9..6d31ded41b278226dc70b269dc7af66588e6474e:/src/xbt/context.c diff --git a/src/xbt/context.c b/src/xbt/context.c index 96476aa082..7f1159f17b 100644 --- a/src/xbt/context.c +++ b/src/xbt/context.c @@ -16,18 +16,6 @@ #include "xbt/xbt_os_thread.h" #include "xbt/ex_interface.h" -#ifdef CONTEXT_THREADS - /* This file (context.c) is only loaded in libsimgrid, not libgras. - * xbt_os_thread is only loaded in libgras explicitly, and we need it in - * libsimgrid, but only when it is the backend used to implement the - * xbt_context. So, do load it on need. - */ -#include "xbt/xbt_os_thread.c" -#else -/* if not, load stubs so that all symbols get resolved anyway */ -#include "xbt/xbt_os_thread_stubs.c" -#endif - XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_ctx, xbt, "Context"); #define VOIRP(expr) DEBUG1(" {" #expr " = %p }", expr) @@ -68,6 +56,7 @@ static void __xbt_context_yield(xbt_context_t context) current_context = self; } #else /* use SUSv2 contexts */ + VOIRP(current_context); if (current_context) VOIRP(current_context->save); @@ -264,6 +253,7 @@ void xbt_context_init(void) current_context = init_context = xbt_new0(s_xbt_context_t, 1); DEBUG1("Init Context (%p)", init_context); + init_context->iwannadie = 0; /* useless but makes valgrind happy */ init_context->exception = xbt_new(ex_ctx_t, 1); XBT_CTX_INITIALIZE(init_context->exception); __xbt_ex_ctx = __context_ex_ctx; @@ -367,6 +357,8 @@ xbt_context_t xbt_context_new(xbt_main_func_t code, pth_sksize_makecontext(res->stack, STACK_SIZE); #endif /* CONTEXT_THREADS or not */ + res->iwannadie = 0; /* useless but makes valgrind happy */ + res->argc = argc; res->argv = argv; res->startup_func = startup_func;