Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 13 May 2012 21:22:15 +0000 (23:22 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 13 May 2012 21:22:15 +0000 (23:22 +0200)
ChangeLog
buildtools/Cmake/DefinePackages.cmake
include/xbt/xbt_os_thread.h [moved from src/include/xbt/xbt_os_thread.h with 92% similarity]

index 3fbc1e3..5113bc9 100644 (file)
--- 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.
index 18674f0..9a831ed 100644 (file)
@@ -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
similarity index 92%
rename from src/include/xbt/xbt_os_thread.h
rename to include/xbt/xbt_os_thread.h
index e744be5..bcebc8f 100644 (file)
@@ -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 <pthread.h>
-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 <WinDef.h>
 typedef DWORD xbt_os_thread_key_t;
+#else /* assume that every non-windows system is POSIX-compatible */
+#include <pthread.h>
+typedef pthread_key_t xbt_os_thread_key_t;
 #endif
 
 /* Calls pthread_atfork() if present, and else does nothing.