Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Drop xbt_os_mutex_* functions.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 16 Jan 2019 16:36:54 +0000 (17:36 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 16 Jan 2019 17:37:17 +0000 (18:37 +0100)
13 files changed:
doc/doxygen/module-xbt.doc
include/xbt.h
include/xbt/xbt_os_thread.h [deleted file]
src/bindings/java/JavaContext.hpp
src/include/xbt/parmap.hpp
src/kernel/context/ContextBoost.hpp
src/kernel/context/ContextRaw.hpp
src/kernel/context/ContextThread.cpp
src/kernel/context/ContextThread.hpp
src/kernel/context/ContextUnix.hpp
src/xbt/xbt_os_thread.c [deleted file]
tools/cmake/DefinePackages.cmake
tools/cmake/Flags.cmake

index 6a0c846..c9b0295 100644 (file)
@@ -77,7 +77,6 @@
      /** @defgroup XBT_graph General purpose graph library */
      /** @defgroup XBT_parmap Parallel map */    
      /** @defgroup XBT_synchro Simulated Synchronization */    
-     /** @defgroup XBT_thread Thread stuff */  
      /** @defgroup XBT_context Portable context implementation */              
      /** @defgroup XBT_replay Replay */
 /** @} */ 
index 8e603db..557b45f 100644 (file)
@@ -29,7 +29,6 @@
 #endif
 #include <xbt/cunit.h>
 
-#include <xbt/xbt_os_thread.h>
 #include <xbt/xbt_os_time.h>
 
 #endif /* XBT_H */
diff --git a/include/xbt/xbt_os_thread.h b/include/xbt/xbt_os_thread.h
deleted file mode 100644 (file)
index a1c4de9..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/* xbt/xbt_os_thread.h -- Thread portability layer                          */
-
-/* Copyright (c) 2007-2019. 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 <xbt/base.h>
-#include <xbt/function_types.h>
-
-SG_BEGIN_DECL()
-
-/** @addtogroup XBT_thread
- *  @brief Thread portability layer
- *
- *  This section describes the thread portability layer. It defines types and functions very close to the pthread API,
- *  but it's portable to windows too.
- *
- *  @{
- */
-
-/** @brief Thread mutex data type (opaque structure) */
-typedef struct xbt_os_mutex_ *xbt_os_mutex_t;
-XBT_PUBLIC xbt_os_mutex_t xbt_os_mutex_init(void);
-XBT_PUBLIC void xbt_os_mutex_acquire(xbt_os_mutex_t mutex);
-XBT_PUBLIC void xbt_os_mutex_release(xbt_os_mutex_t mutex);
-XBT_PUBLIC void xbt_os_mutex_destroy(xbt_os_mutex_t mutex);
-
-/** @} */
-
-SG_END_DECL()
-#endif /* XBT_OS_THREAD_H */
index 47fe472..108b2f2 100644 (file)
@@ -14,7 +14,6 @@
 #include "simgrid/simix.h"
 #include "src/kernel/context/ContextThread.hpp"
 #include "src/simix/smx_private.hpp"
-#include "xbt/xbt_os_thread.h"
 
 #include "jmsg.hpp"
 
index b82c126..fc8f6da 100644 (file)
@@ -10,7 +10,6 @@
 
 #include "src/internal_config.h" // HAVE_FUTEX_H
 #include "src/kernel/context/Context.hpp"
-#include "xbt/xbt_os_thread.h"
 
 #include <boost/optional.hpp>
 #include <condition_variable>
index a23d96b..99dad30 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <simgrid/simix.hpp>
 #include <xbt/parmap.hpp>
-#include <xbt/xbt_os_thread.h>
 
 #include "src/internal_config.h"
 #include "src/kernel/context/Context.hpp"
index b966a15..89e72bc 100644 (file)
@@ -12,7 +12,6 @@
 #include <vector>
 
 #include <xbt/parmap.hpp>
-#include <xbt/xbt_os_thread.h>
 
 #include "src/kernel/context/ContextSwapped.hpp"
 
index b78153f..a3c6088 100644 (file)
@@ -10,7 +10,6 @@
 #include "src/simix/smx_private.hpp"
 #include "src/xbt_modinter.h" /* prototype of os thread module's init/exit in XBT */
 #include "xbt/function_types.h"
-#include "xbt/xbt_os_thread.h"
 
 #include <functional>
 #include <utility>
index 0dfc83b..4c76ae2 100644 (file)
@@ -11,7 +11,6 @@
 #include "simgrid/simix.hpp"
 #include "src/kernel/context/Context.hpp"
 #include "src/xbt/OsSemaphore.hpp"
-#include "xbt/xbt_os_thread.h"
 
 #include <thread>
 
index 350a87c..211da7e 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <simgrid/simix.hpp>
 #include <xbt/parmap.hpp>
-#include <xbt/xbt_os_thread.h>
 
 #include "src/internal_config.h"
 #include "src/kernel/context/ContextSwapped.hpp"
diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c
deleted file mode 100644 (file)
index e7a5c99..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* 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 HAVE_UCONTEXT_CONTEXTS, xbt_os_thread_stub is used instead   */
-
-/* Copyright (c) 2007-2019. 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. */
-
-#include "src/internal_config.h"
-#if HAVE_PTHREAD_SETAFFINITY
-#define _GNU_SOURCE
-#include <sched.h>
-#endif
-
-#include <pthread.h>
-
-#include <limits.h>
-#include <semaphore.h>
-#include <errno.h>
-
-#if defined(_WIN32)
-#include <windows.h>
-#elif defined(__MACH__) && defined(__APPLE__)
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#else
-#include <unistd.h>
-#endif
-
-#include "xbt/sysdep.h"
-#include "xbt/ex.h"
-#include "src/internal_config.h"
-#include "xbt/xbt_os_time.h"       /* Portable time facilities */
-#include "xbt/xbt_os_thread.h"     /* 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)");
-
-/****** mutex related functions ******/
-typedef struct xbt_os_mutex_ {
-  pthread_mutex_t m;
-} s_xbt_os_mutex_t;
-
-#include <time.h>
-#include <math.h>
-
-xbt_os_mutex_t xbt_os_mutex_init(void)
-{
-  pthread_mutexattr_t Attr;
-  pthread_mutexattr_init(&Attr);
-  pthread_mutexattr_settype(&Attr, PTHREAD_MUTEX_RECURSIVE);
-
-  xbt_os_mutex_t res = xbt_new(s_xbt_os_mutex_t, 1);
-  int errcode = pthread_mutex_init(&(res->m), &Attr);
-  xbt_assert(errcode==0, "pthread_mutex_init() failed: %s", strerror(errcode));
-
-  return res;
-}
-
-void xbt_os_mutex_acquire(xbt_os_mutex_t mutex)
-{
-  int errcode = pthread_mutex_lock(&(mutex->m));
-  xbt_assert(errcode==0, "pthread_mutex_lock(%p) failed: %s", mutex, strerror(errcode));
-}
-
-void xbt_os_mutex_release(xbt_os_mutex_t mutex)
-{
-  int errcode = pthread_mutex_unlock(&(mutex->m));
-  xbt_assert(errcode==0, "pthread_mutex_unlock(%p) failed: %s", mutex, strerror(errcode));
-}
-
-void xbt_os_mutex_destroy(xbt_os_mutex_t mutex)
-{
-  if (!mutex)
-    return;
-
-  int errcode = pthread_mutex_destroy(&(mutex->m));
-  xbt_assert(errcode == 0, "pthread_mutex_destroy(%p) failed: %s", mutex, strerror(errcode));
-  free(mutex);
-}
index 584ff4c..ac60b02 100644 (file)
@@ -292,7 +292,6 @@ set(XBT_SRC
   src/xbt/xbt_main.cpp
   src/xbt/xbt_os_file.cpp
   src/xbt/xbt_os_synchro.cpp
-  src/xbt/xbt_os_thread.c
   src/xbt/xbt_os_time.c
   src/xbt/xbt_replay.cpp
   src/xbt/xbt_str.cpp
@@ -780,7 +779,6 @@ set(headers_to_install
   include/xbt/system_error.hpp
   include/xbt/utility.hpp
   include/xbt/virtu.h
-  include/xbt/xbt_os_thread.h
   include/xbt/xbt_os_time.h
   )
 set(source_of_generated_headers
index 653f50d..f2e828e 100644 (file)
@@ -157,7 +157,7 @@ if(enable_model-checking AND enable_compile_optimizations)
       src/xbt/dict.cpp src/xbt/dict_elm.c src/xbt/dict_cursor.c
       src/xbt/dynar.cpp
       src/xbt/xbt_str.cpp src/xbt/snprintf.c
-      src/xbt/xbt_os_time.c src/xbt/xbt_os_thread.c
+      src/xbt/xbt_os_time.c
       src/xbt/backtrace_linux.cpp
       ${MC_SRC_BASE} ${MC_SRC})
       set (mcCFLAGS "-O3  -funroll-loops -fno-strict-aliasing")