From: degomme Date: Fri, 4 Mar 2016 13:14:46 +0000 (+0100) Subject: We actually want to try pthreads on windows, as the others are failing now. X-Git-Tag: v3_13~561^2~2^2~2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7ec868edc2667ea50fa2f69c8d9aa76e9c97397c?hp=b171931829c14f0ad84cc15e2bf012560982bf75 We actually want to try pthreads on windows, as the others are failing now. If it works properly we may remove raw and win32_ucontext support. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 914ee76c7c..eec70e6182 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -280,13 +280,12 @@ CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DLOPEN_IN_LIBDL) CHECK_LIBRARY_EXISTS(execinfo backtrace "" HAVE_BACKTRACE_IN_LIBEXECINFO) CHECK_LIBRARY_EXISTS(rt clock_gettime "" HAVE_POSIX_GETTIME) -if(NOT WIN32) # We don't want to have winpthread-1.dll in the jarfile - CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_PTHREAD) - CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB) - CHECK_LIBRARY_EXISTS(pthread sem_open "" HAVE_SEM_OPEN_LIB) - CHECK_LIBRARY_EXISTS(pthread sem_timedwait "" HAVE_SEM_TIMEDWAIT_LIB) - CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB) -endif() +CHECK_LIBRARY_EXISTS(pthread pthread_create "" HAVE_PTHREAD) +CHECK_LIBRARY_EXISTS(pthread sem_init "" HAVE_SEM_INIT_LIB) +CHECK_LIBRARY_EXISTS(pthread sem_open "" HAVE_SEM_OPEN_LIB) +CHECK_LIBRARY_EXISTS(pthread sem_timedwait "" HAVE_SEM_TIMEDWAIT_LIB) +CHECK_LIBRARY_EXISTS(pthread pthread_mutex_timedlock "" HAVE_MUTEX_TIMEDLOCK_LIB) + if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(CMAKE_REQUIRED_DEFINITIONS "-D_XOPEN_SOURCE=700 -D_DARWIN_C_SOURCE") diff --git a/include/xbt/xbt_os_thread.h b/include/xbt/xbt_os_thread.h index b7d7d95d64..93efd01143 100644 --- a/include/xbt/xbt_os_thread.h +++ b/include/xbt/xbt_os_thread.h @@ -27,13 +27,10 @@ typedef struct xbt_os_thread_ *xbt_os_thread_t; #ifdef _XBT_WIN32 /* defined if this is a windows system, 32bits or 64bits) */ #include -typedef DWORD xbt_os_thread_key_t; -#else /* assume that every non-windows system is POSIX-compatible */ +#endif #include typedef pthread_key_t xbt_os_thread_key_t; -#endif - /** Calls pthread_atfork() if present, and raise an exception otherwise. * * The only known user of this wrapper is mmalloc_preinit(), but it is absolutely mandatory there: