Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modernize simcall mutex_trylock.
[simgrid.git] / src / simix / smx_global.cpp
index f89e0dbdc816d1349a6068c3de1601c56ed63d8b..3d2ec1d47a24a42c2f4255b228ac61dd70018442 100644 (file)
 #include "src/mc/mc_record.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/simix/smx_private.hpp"
-#include "src/surf/StorageImpl.hpp"
 #include "src/surf/xml/platf.hpp"
 
+#include "simgrid/kernel/resource/Model.hpp"
+
 #if SIMGRID_HAVE_MC
 #include "src/mc/remote/AppSide.hpp"
 #endif
@@ -87,8 +88,6 @@ static void segvhandler(int signum, siginfo_t* siginfo, void* /*context*/)
   std::raise(signum);
 }
 
-std::array<unsigned char, SIGSTKSZ> sigsegv_stack; /* alternate stack for SIGSEGV handler */
-
 /**
  * Install signal handler for SIGSEGV.  Check that nobody has already installed
  * its own handler.  For example, the Java VM does this.
@@ -308,7 +307,6 @@ void SIMIX_global_init(int *argc, char **argv)
     atexit(SIMIX_clean);
 }
 
-int smx_cleaned = 0;
 /**
  * @ingroup SIMIX_API
  * @brief Clean the SIMIX simulation
@@ -317,10 +315,11 @@ int smx_cleaned = 0;
  */
 void SIMIX_clean()
 {
+  static bool smx_cleaned = false;
   if (smx_cleaned)
     return; // to avoid double cleaning by java and C
 
-  smx_cleaned = 1;
+  smx_cleaned = true;
   XBT_DEBUG("SIMIX_clean called. Simulation's over.");
   if (not simix_global->actors_to_run.empty() && SIMIX_get_clock() <= 0.0) {
     XBT_CRITICAL("   ");