From: Martin Quinson Date: Sun, 13 May 2012 21:22:15 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_7~11 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/0766ec711b34875972c4ece311c4e1c472f25d5f?hp=810b87373b72c093f757b135e2840bcb767d8c73 Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/ChangeLog b/ChangeLog index 3fbc1e397b..5113bc9b11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -118,6 +118,9 @@ SimGrid (3.7) NOT RELEASED; urgency=low you have less than 2 million elements in your dynar and don't want of the extra complexity of catching exceptions when the element is not found. + * Portability layer + - Make xbt_os_thread module (for thread portability) public. + Documentation is still to come, sorry. * mmalloc module: - Cleanups and simplifications to make it maintainable again. - Exotic features (such as memalign and valloc) were removed. diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 18674f07ae..9a831ede59 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -57,7 +57,6 @@ set(EXTRA_DIST src/include/surf/surf_resource_lmm.h src/include/xbt/wine_dbghelp.h src/include/xbt/xbt_os_time.h - src/include/xbt/xbt_os_thread.h src/include/mc/datatypes.h src/include/mc/mc.h src/include/simix/context.h @@ -435,6 +434,7 @@ set(headers_to_install include/xbt/datadesc.h include/xbt/socket.h include/xbt/file_stat.h + include/xbt/xbt_os_thread.h include/simgrid/platf.h include/simgrid/modelchecker.h include/simgrid/simix.h diff --git a/src/include/xbt/xbt_os_thread.h b/include/xbt/xbt_os_thread.h similarity index 92% rename from src/include/xbt/xbt_os_thread.h rename to include/xbt/xbt_os_thread.h index e744be5ff5..bcebc8febb 100644 --- a/src/include/xbt/xbt_os_thread.h +++ b/include/xbt/xbt_os_thread.h @@ -1,17 +1,14 @@ -/* xbt/xbt_thread.h -- Thread portability layer */ +/* xbt/xbt_os_thread.h -- Thread portability layer */ -/* Copyright (c) 2007, 2009, 2010. The SimGrid Team. - * All rights reserved. */ +/* Copyright (c) 2007-2012. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ - #ifndef _XBT_OS_THREAD_H #define _XBT_OS_THREAD_H -#include "gras_config.h" -#include "xbt/misc.h" /* SG_BEGIN_DECL */ +#include "simgrid_config.h" /* Windows or Posix */ #include "xbt/function_types.h" SG_BEGIN_DECL() @@ -27,12 +24,12 @@ SG_BEGIN_DECL() /** \brief Thread data type (opaque structure) */ typedef struct xbt_os_thread_ *xbt_os_thread_t; -#ifdef HAVE_PTHREAD_H -#include -typedef pthread_key_t xbt_os_thread_key_t; -#elif defined(_XBT_WIN32) +#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 */ +#include +typedef pthread_key_t xbt_os_thread_key_t; #endif /* Calls pthread_atfork() if present, and else does nothing.