constructor: allow default logic;
authorwenzelm
Sun, 16 Dec 2007 13:05:53 +0100
changeset 25661 dcee4bb2ba5c
parent 25660 097f1384e371
child 25662 8c45834392e7
constructor: allow default logic; kill: refer to "isabelle.kill" system property;
lib/classes/isabelle/IsabelleProcess.java
--- a/lib/classes/isabelle/IsabelleProcess.java	Sun Dec 16 13:05:07 2007 +0100
+++ b/lib/classes/isabelle/IsabelleProcess.java	Sun Dec 16 13:05:53 2007 +0100
@@ -78,9 +78,11 @@
     public synchronized void interrupt() throws IsabelleProcessException
     {
         if (proc != null && pid != null) {
+            String kill = System.getProperty("isabelle.kill", "kill");
+            String [] cmdline = {kill, "-INT", pid};
             try {
                 putResult(Result.Kind.SIGNAL, "INT");
-                int rc = Runtime.getRuntime().exec("kill -INT " + pid).waitFor();
+                int rc = Runtime.getRuntime().exec(cmdline).waitFor();
                 if (rc != 0) {
                     throw new IsabelleProcessException("Cannot interrupt: kill command failed");
                 }
@@ -363,7 +365,7 @@
             cmdline.add("isabelle-process");
         }
         cmdline.add("-W");
-        cmdline.add(logic);
+        if (logic != null) cmdline.add(logic);
 
         try {
             String [] cmd = new String[cmdline.size()];
@@ -395,4 +397,8 @@
         errorThread.start();
         exitThread.start();
     }
+    
+    public IsabelleProcess() throws IsabelleProcessException {
+        this(null);
+    }
 }