Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
allow java actors to kill themselves
[simgrid.git] / examples / java / process / kill / Killer.java
index 35c7990..18b0645 100644 (file)
@@ -23,7 +23,9 @@ public class Killer extends Process {
       poorVictim = new Victim("Boivin","victim");
       poorVictim.start();
     } catch (MsgException e){
-      System.out.println("Cannot create the victim process!");
+      e.printStackTrace();
+      Msg.error("Cannot create the victim process!");
+      return;
     }
     sleep(10000);
     Msg.info("Resume Process");
@@ -33,5 +35,6 @@ public class Killer extends Process {
     poorVictim.kill();
 
     Msg.info("Ok, goodbye now.");
+    exit(); // This would be more useful if not placed on the last line
   }
 }