Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make sure that the dtor of CheckerSide actually kills the application and waits for it
[simgrid.git] / src / mc / remote / CheckerSide.hpp
index 55f7b32..17fb33c 100644 (file)
@@ -18,12 +18,8 @@ namespace simgrid::mc {
 /* CheckerSide: All what the checker needs to interact with a given application process */
 
 class CheckerSide {
-  void (*const free_event_fun)(event*) = [](event* evt) {
-    event_del(evt);
-    event_free(evt);
-  };
-  std::unique_ptr<event, decltype(&event_free)> socket_event_{nullptr, &event_free};
-  std::unique_ptr<event, decltype(&event_free)> signal_event_{nullptr, &event_free};
+  event* socket_event_;
+  event* signal_event_;
   std::unique_ptr<event_base, decltype(&event_base_free)> base_{nullptr, &event_base_free};
   std::unique_ptr<RemoteProcessMemory> remote_memory_;
 
@@ -37,6 +33,7 @@ class CheckerSide {
 
 public:
   explicit CheckerSide(const std::vector<char*>& args, bool need_memory_introspection);
+  ~CheckerSide();
 
   // No copy:
   CheckerSide(CheckerSide const&) = delete;
@@ -52,6 +49,9 @@ public:
   void break_loop() const;
   void wait_for_requests();
 
+  /** Ask the application to run post-mortem analysis, and maybe to stop ASAP */
+  void finalize(bool terminate_asap = false);
+
   /* Interacting with the application process */
   pid_t get_pid() const { return pid_; }
   bool running() const { return running_; }