X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1e19722bba40db422336bb1330356a609b138ed0..ce6136d5f1a9ce68cfa6c968c257bd6c00c531d7:/src/xbt/xbt_os_thread.c diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c index 91db34bd79..095a28c435 100644 --- a/src/xbt/xbt_os_thread.c +++ b/src/xbt/xbt_os_thread.c @@ -1,6 +1,6 @@ /* xbt_os_thread -- portability layer over the pthread API */ /* Used in RL to get win/lin portability, and in SG when CONTEXT_THREAD */ -/* in SG, when using CONTEXT_UCONTEXT, xbt_os_thread_stub is used instead */ +/* in SG, when using HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead */ /* Copyright (c) 2007-2015. The SimGrid Team. * All rights reserved. */ @@ -17,14 +17,14 @@ #include #endif -#include "internal_config.h" +#include "src/internal_config.h" #include "xbt/sysdep.h" #include "xbt/ex.h" -#include "xbt/ex_interface.h" /* We play crude games with exceptions */ -#include "portable.h" +#include "src/xbt/ex_interface.h" /* We play crude games with exceptions */ +#include "src/portable.h" #include "xbt/xbt_os_time.h" /* Portable time facilities */ #include "xbt/xbt_os_thread.h" /* This module */ -#include "xbt_modinter.h" /* Initialization/finalization of this module */ +#include "src/xbt_modinter.h" /* Initialization/finalization of this module */ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_sync_os, xbt, "Synchronization mechanism (OS-level)"); @@ -291,14 +291,10 @@ void xbt_os_thread_exit(int *retval) xbt_os_thread_t xbt_os_thread_self(void) { - xbt_os_thread_t res; - if (!thread_mod_inited) return NULL; - res = pthread_getspecific(xbt_self_thread_key); - - return res; + return pthread_getspecific(xbt_self_thread_key); } void xbt_os_thread_key_create(xbt_os_thread_key_t* key) { @@ -1303,8 +1299,7 @@ void xbt_os_thread_set_extra_data(void *data) void *xbt_os_thread_get_extra_data(void) { - xbt_os_thread_t self = xbt_os_thread_self(); - return self? self->extra_data : NULL; + return xbt_os_thread_self()->extra_data; } xbt_os_rmutex_t xbt_os_rmutex_init(void)