]> AND Public Git Repository - simgrid.git/blobdiff - examples/s4u/actor-lifetime/s4u-actor-lifetime.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
[simgrid.git] / examples / s4u / actor-lifetime / s4u-actor-lifetime.cpp
index 41a62d5743f070407481fced28fc3d756e2879d6..9ec27537000ffc3a87b3eb08567be81bb7630578 100644 (file)
@@ -3,12 +3,15 @@
 /* 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. */
 
+/* This C++ file acts as the foil to the corresponding XML file, where the
+   action takes place: Actors are started and stopped at predefined time.   */
+
 #include "simgrid/s4u.hpp"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Messages specific for this s4u example");
 
 /* Executed on process termination, to display a message helping to understand the output */
-static int my_onexit(void* ignored1, void* ignored2)
+static int my_onexit(void*, void*)
 {
   XBT_INFO("Exiting now (done sleeping or got killed).");
   return 0;
@@ -18,10 +21,10 @@ static int my_onexit(void* ignored1, void* ignored2)
 class sleeper {
 
 public:
-  explicit sleeper(std::vector<std::string> args)
+  explicit sleeper(std::vector<std::string> /*args*/)
   {
     XBT_INFO("Hello! I go to sleep.");
-    simcall_process_on_exit(SIMIX_process_self(), my_onexit, NULL);
+    simgrid::s4u::this_actor::onExit(my_onexit, NULL);
 
     simgrid::s4u::this_actor::sleep_for(10);
   }