Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of framagit.org:simgrid/simgrid
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 16 Jan 2019 21:57:19 +0000 (22:57 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 16 Jan 2019 21:57:19 +0000 (22:57 +0100)
24 files changed:
doc/doxygen/module-xbt.doc
include/xbt.h
include/xbt/xbt_os_thread.h [deleted file]
sonar-project.properties
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/log.cpp [moved from src/xbt/log.c with 97% similarity]
src/xbt/log_private.hpp [moved from src/xbt/log_private.h with 100% similarity]
src/xbt/mmalloc/mmprivate.h
src/xbt/xbt_log_appender_file.cpp [moved from src/xbt/xbt_log_appender_file.c with 94% similarity]
src/xbt/xbt_log_layout_format.cpp [moved from src/xbt/xbt_log_layout_format.c with 98% similarity]
src/xbt/xbt_log_layout_simple.cpp [moved from src/xbt/xbt_log_layout_simple.c with 98% similarity]
src/xbt/xbt_os_thread.c [deleted file]
teshsuite/msg/CMakeLists.txt
teshsuite/msg/task-priority/task-priority.tesh
teshsuite/simix/CMakeLists.txt
tools/cmake/DefinePackages.cmake
tools/cmake/Distrib.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 e21a5d1..0000000
+++ /dev/null
@@ -1,37 +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>
-
-#include <pthread.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 8f3db25..ee80b41 100644 (file)
@@ -131,7 +131,7 @@ sonar.sourceEncoding=UTF-8
 
 # Version of the used prog languages
 sonar.java.source=7
-sonar.java.binaries=CMakeFiles/simgrid-java_jar.dir,examples/java
+sonar.java.binaries=CMakeFiles/simgrid-java_jar.dir,examples/deprecated/java
 
 # Don't talk to me: travis don't like your verbosity
 # sonar.verbose=true
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 a94e689..4e073a1 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"
similarity index 97%
rename from src/xbt/log.c
rename to src/xbt/log.cpp
index 2345560..38dbba0 100644 (file)
@@ -5,23 +5,23 @@
 /* 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 <stdarg.h>
 #include <ctype.h>
-#include <stdio.h>              /* snprintf */
-#include <stdlib.h>             /* snprintf */
+#include <mutex>
+#include <stdarg.h>
+#include <stdio.h>  /* snprintf */
+#include <stdlib.h> /* snprintf */
 
 #include "src/internal_config.h"
 
 #include "src/xbt_modinter.h"
 
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
 #include "xbt/asserts.h"
 #include "xbt/dynar.h"
 #include "xbt/ex.h"
 #include "xbt/misc.h"
 #include "xbt/str.h"
 #include "xbt/sysdep.h"
-#include "xbt/xbt_os_thread.h"
 
 #ifndef MIN
 #define MIN(a, b) ((a) < (b) ? (a) : (b))
@@ -31,7 +31,7 @@
 #endif
 
 int xbt_log_no_loc = 0; /* if set to true (with --log=no_loc), file localization will be omitted (for tesh tests) */
-static xbt_os_mutex_t log_cat_init_mutex = NULL;
+static std::recursive_mutex* log_cat_init_mutex = nullptr;
 
 /** @addtogroup XBT_log
  *
@@ -95,7 +95,7 @@ void xbt_log_preinit(void)
   xbt_log_default_layout = xbt_log_layout_simple_new(NULL);
   _XBT_LOGV(XBT_LOG_ROOT_CAT).appender = xbt_log_default_appender;
   _XBT_LOGV(XBT_LOG_ROOT_CAT).layout = xbt_log_default_layout;
-  log_cat_init_mutex = xbt_os_mutex_init();
+  log_cat_init_mutex                   = new std::recursive_mutex();
 }
 
 static void xbt_log_help(void);
@@ -165,7 +165,7 @@ static void log_cat_exit(xbt_log_category_t cat)
 void xbt_log_postexit(void)
 {
   XBT_VERB("Exiting log");
-  xbt_os_mutex_destroy(log_cat_init_mutex);
+  delete log_cat_init_mutex;
   xbt_dynar_free(&xbt_log_settings);
   log_cat_exit(&_XBT_LOGV(XBT_LOG_ROOT_CAT));
 }
@@ -181,8 +181,8 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
   xbt_log_category_t cat = ev->cat;
 
   xbt_assert(ev->priority >= 0, "Negative logging priority naturally forbidden");
-  xbt_assert(ev->priority < sizeof(xbt_log_priority_names), "Priority %d is greater than the biggest allowed value",
-             ev->priority);
+  xbt_assert(static_cast<size_t>(ev->priority) < sizeof(xbt_log_priority_names)/sizeof(xbt_log_priority_names[0]),
+             "Priority %d is greater than the biggest allowed value", ev->priority);
 
   while (1) {
     xbt_log_appender_t appender = cat->appender;
@@ -204,7 +204,7 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
 
         /* The static buffer was too small, use a dynamically expanded one */
         ev->buffer_size = XBT_LOG_DYNAMIC_BUFFER_SIZE;
-        ev->buffer      = xbt_malloc(ev->buffer_size);
+        ev->buffer      = static_cast<char*>(xbt_malloc(ev->buffer_size));
         while (1) {
           va_start(ev->ap, fmt);
           done = cat->layout->do_layout(cat->layout, ev, fmt);
@@ -212,7 +212,7 @@ void _xbt_log_event_log(xbt_log_event_t ev, const char *fmt, ...)
           if (done)
             break; /* Got it */
           ev->buffer_size *= 2;
-          ev->buffer = xbt_realloc(ev->buffer, ev->buffer_size);
+          ev->buffer = static_cast<char*>(xbt_realloc(ev->buffer, ev->buffer_size));
         }
         appender->do_append(appender, ev->buffer);
         xbt_free(ev->buffer);
@@ -281,11 +281,11 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
 {
   DISABLE_XBT_LOG_CAT_INIT();
   if (log_cat_init_mutex != NULL)
-    xbt_os_mutex_acquire(log_cat_init_mutex);
+    log_cat_init_mutex->lock();
 
   if (category->initialized) {
     if (log_cat_init_mutex != NULL)
-      xbt_os_mutex_release(log_cat_init_mutex);
+      log_cat_init_mutex->unlock();
     return priority >= category->threshold;
   }
 
@@ -355,7 +355,7 @@ int _xbt_log_cat_init(xbt_log_category_t category, e_xbt_log_priority_t priority
 
   category->initialized = 1;
   if (log_cat_init_mutex != NULL)
-    xbt_os_mutex_release(log_cat_init_mutex);
+    log_cat_init_mutex->unlock();
   return priority >= category->threshold;
 }
 
index c05e9e3..9784131 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "swag.h"
 #include "src/internal_config.h"
-#include "xbt/xbt_os_thread.h"
 #include "xbt/mmalloc.h"
 #include "xbt/ex.h"
 #include "xbt/dynar.h"
similarity index 94%
rename from src/xbt/xbt_log_appender_file.c
rename to src/xbt/xbt_log_appender_file.cpp
index 13b7da8..7d9313e 100644 (file)
@@ -7,7 +7,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "src/internal_config.h"
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
 #include "xbt/sysdep.h"
 #include <errno.h>
 #include <stdio.h>
@@ -19,7 +19,7 @@ static void append_file(xbt_log_appender_t this_, char *str) {
 
 static void free_(xbt_log_appender_t this_) {
   if (this_->data != stderr)
-    fclose(this_->data);
+    fclose(static_cast<FILE*>(this_->data));
 }
 
 xbt_log_appender_t xbt_log_appender_file_new(char *arg) {
@@ -94,7 +94,7 @@ static void append2_file(xbt_log_appender_t this_, char *str) {
 
 static void free_append2_(xbt_log_appender_t this_)
 {
-  xbt_log_append2_file_t data = this_->data;
+  xbt_log_append2_file_t data = static_cast<xbt_log_append2_file_t>(this_->data);
   if (data->file)
     fclose(data->file);
   xbt_free(data->filename);
@@ -114,7 +114,7 @@ xbt_log_appender_t xbt_log_appender2_file_new(char *arg,int roll) {
   xbt_assert(arg);
   char* buf=xbt_strdup(arg);
   char* sep=strchr(buf,':');
-  xbt_assert(sep>0);
+  xbt_assert(sep != NULL);
   data->filename=xbt_strdup(sep+1);
   *sep='\0';
   char *endptr;
similarity index 98%
rename from src/xbt/xbt_log_layout_format.c
rename to src/xbt/xbt_log_layout_format.cpp
index 7726483..3243b77 100644 (file)
@@ -7,7 +7,7 @@
 
 #include "simgrid/host.h"
 #include "simgrid/msg.h" /* MSG_get_clock */
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
 #include "xbt/sysdep.h"
 #include <stdio.h>
 
@@ -80,7 +80,7 @@ static int xbt_log_layout_format_doit(xbt_log_layout_t l, xbt_log_event_t ev, co
   int precision = -1;
   int length = -1;
 
-  for (char* q = l->data ; *q != '\0' ; q++) {
+  for (char* q = static_cast<char*>(l->data) ; *q != '\0' ; q++) {
     if (*q == '%') {
       q++;
       do {
similarity index 98%
rename from src/xbt/xbt_log_layout_simple.c
rename to src/xbt/xbt_log_layout_simple.cpp
index fbe3c80..f4179ae 100644 (file)
@@ -6,7 +6,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/sysdep.h"
-#include "src/xbt/log_private.h"
+#include "src/xbt/log_private.hpp"
 
 #include "simgrid/host.h" /* sg_host_self_get_name */
 #include "simgrid/msg.h"  /* MSG_get_clock */
diff --git a/src/xbt/xbt_os_thread.c b/src/xbt/xbt_os_thread.c
deleted file mode 100644 (file)
index a89cf69..0000000
+++ /dev/null
@@ -1,87 +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>
-
-#if defined(__FreeBSD__)
-#include "pthread_np.h"
-#define cpu_set_t cpuset_t
-#endif
-
-#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 83c1572..d2543b5 100644 (file)
@@ -93,6 +93,7 @@ foreach(x
     energy-consumption energy-ptask
     io-file io-raw-storage io-file-remote
     platform-properties
+    task-priority
     plugin-hostload
     trace_integration)
   ADD_TESH_FACTORIES(tesh-msg-${x} "raw" 
index 5679db9..19886bd 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env tesh
 
 ! output sort 19
-$ $SG_TEST_EXENV ${bindir:=.}/task-priority$EXEEXT ${platfdir}/small_platform.xml  ${srcdir}/task-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
+$ $SG_TEST_EXENV ${bindir:=.}/task-priority$EXEEXT ${platfdir}/small_platform.xml  ${srcdir:=.}/task-priority_d.xml "--log=root.fmt:[%10.6r]%e(%i:%P@%h)%e%m%n"
 > [  0.000000] (1:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 1
 > [  0.000000] (2:test@Fafard) Hello! Running a task of size 7.6296e+07 with priority 2
 > [  1.500000] (2:test@Fafard) Goodbye now!
index 56d0c01..2af3e96 100644 (file)
@@ -27,7 +27,7 @@ ELSE()
 ENDIF()
 
 if (NOT enable_memcheck AND NOT enable_address_sanitizer)
-  ADD_TESH_FACTORIES(stack-overflow   "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/stack-overflow --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack-overflow stack-overflow.tesh)
+  ADD_TESH_FACTORIES(stack-overflow   "ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/stack-overflow --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/stack-overflow stack-overflow.tesh)
 endif()
 if (NOT enable_memcheck)
   ADD_TESH_FACTORIES(generic-simcalls "thread;ucontext;raw;boost" --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/generic-simcalls --setenv srcdir=${CMAKE_HOME_DIRECTORY} --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/generic-simcalls generic-simcalls.tesh)
@@ -35,10 +35,10 @@ endif()
 
 foreach (factory raw thread boost ucontext)
   string (TOUPPER have_${factory}_contexts VARNAME)
+  if (release AND ${VARNAME} AND (WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Darwin"))
+    SET_TESTS_PROPERTIES(stack-overflow-${factory} PROPERTIES WILL_FAIL true)
+  endif()
   if (${factory} STREQUAL "thread" OR ${VARNAME})
-    if (release AND (WIN32 OR CMAKE_SYSTEM_NAME MATCHES "Darwin"))
-      SET_TESTS_PROPERTIES(stack-overflow-${factory} PROPERTIES WILL_FAIL true)
-    endif()
     ADD_TESH(tesh-simix-factory-${factory} --cfg contexts/factory:${factory} --setenv bindir=${CMAKE_BINARY_DIR}/teshsuite/simix/check-defaults --cd ${CMAKE_HOME_DIRECTORY}/teshsuite/simix/check-defaults factory_${factory}.tesh)
   endif()
 endforeach()
index 19738ea..ac60b02 100644 (file)
@@ -67,7 +67,7 @@ set(EXTRA_DIST
   src/xbt/automaton/parserPromela.tab.hacc
   src/xbt/automaton/parserPromela.yacc
   src/xbt/dict_private.h
-  src/xbt/log_private.h
+  src/xbt/log_private.hpp
   src/xbt/mallocator_private.h
 
   src/xbt/mmalloc/mfree.c
@@ -278,7 +278,7 @@ set(XBT_SRC
   src/xbt/dynar.cpp
   src/xbt/exception.cpp
   src/xbt/graph.c
-  src/xbt/log.c
+  src/xbt/log.cpp
   src/xbt/mallocator.c
   src/xbt/memory_map.cpp
   src/xbt/memory_map.hpp
@@ -286,13 +286,12 @@ set(XBT_SRC
   src/xbt/parmap.cpp
   src/xbt/snprintf.c
   src/xbt/string.cpp
-  src/xbt/xbt_log_appender_file.c
-  src/xbt/xbt_log_layout_format.c
-  src/xbt/xbt_log_layout_simple.c
+  src/xbt/xbt_log_appender_file.cpp
+  src/xbt/xbt_log_layout_format.cpp
+  src/xbt/xbt_log_layout_simple.cpp
   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 be2bfb9..c5b9925 100644 (file)
@@ -337,6 +337,7 @@ if(enable_memcheck)
 else()
   add_custom_target(check COMMAND make test)
 endif()
+add_dependencies(check tests)
 
 #######################################
 ### Fill in the "make xxx-clean" target ###
index b9a1b61..f2e828e 100644 (file)
@@ -152,12 +152,12 @@ if(enable_model-checking AND enable_compile_optimizations)
   foreach(s
       src/kernel/lmm/fair_bottleneck.cpp src/kernel/lmm/lagrange.cpp src/kernel/lmm/maxmin.cpp
       src/xbt/mmalloc/mm.c
-      src/xbt/log.c src/xbt/xbt_log_appender_file.c
-      src/xbt/xbt_log_layout_format.c src/xbt/xbt_log_layout_simple.c
+      src/xbt/log.cpp src/xbt/xbt_log_appender_file.cpp
+      src/xbt/xbt_log_layout_format.cpp src/xbt/xbt_log_layout_simple.cpp
       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")