Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / src / kernel / EngineImpl.cpp
index 518361d..ff519e4 100644 (file)
@@ -19,7 +19,6 @@
 #include "src/simgrid/math_utils.h"
 #include "src/simgrid/sg_config.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
-#include "src/xbt/xbt_modinter.h" /* whether initialization was already done */
 
 #include "xbt/log.hpp"
 
@@ -142,12 +141,6 @@ static void install_signal_handlers()
 
 static simgrid::config::Flag<bool> cfg_dbg_clean_atexit{
     "debug/clean-atexit", "Whether to cleanup SimGrid at exit. Disable it if your code segfaults after its end.", true};
-static void xbt_postexit()
-{
-  if (not cfg_dbg_clean_atexit)
-    return;
-  xbt_log_postexit();
-}
 
 namespace simgrid::kernel {
 
@@ -185,10 +178,8 @@ void EngineImpl::initialize(int* argc, char** argv)
   simgrid::mc::AppSide::initialize();
 #endif
 
-  static bool inited = false;
-  if (not inited) {
+  if (static bool inited = false; not inited) {
     inited = true;
-    atexit(xbt_postexit);
     xbt_log_init(argc, argv);
 
     simgrid::xbt::install_exception_handler();
@@ -372,7 +363,7 @@ void EngineImpl::handle_ended_actions() const
         if (action->get_activity()->get_actor() == maestro_)
           action->get_activity()->get_iface()->complete(s4u::Activity::State::FAILED);
 
-        activity::ActivityImplPtr(action->get_activity())->post();
+        activity::ActivityImplPtr(action->get_activity())->finish();
       }
     }
     XBT_DEBUG("Handling the terminated actions (if any)");
@@ -385,7 +376,7 @@ void EngineImpl::handle_ended_actions() const
         if (action->get_activity()->get_actor() == maestro_)
           action->get_activity()->get_iface()->complete(s4u::Activity::State::FINISHED);
 
-        activity::ActivityImplPtr(action->get_activity())->post();
+        activity::ActivityImplPtr(action->get_activity())->finish();
       }
     }
   }