Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
blocker --?
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 30 May 2016 19:17:40 +0000 (21:17 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 30 May 2016 19:17:40 +0000 (21:17 +0200)
examples/java/process/kill/Killer.java

index 49bfc40..2e96690 100644 (file)
@@ -23,6 +23,7 @@ public class Killer extends Process {
       poorVictim = new Victim("Boivin","victim");
       poorVictim.start();
     } catch (MsgException e){
+      e.printStackTrace();
       Msg.error("Cannot create the victim process!");
     }
     sleep(10000);
@@ -31,7 +32,8 @@ public class Killer extends Process {
       poorVictim.resume();
     sleep(1000);
     Msg.info("Kill Process");
-    poorVictim.kill();
+    if (poorVictim != null)
+      poorVictim.kill();
 
     Msg.info("Ok, goodbye now.");
   }