8166655: JShell: Process running JShell should not be blocked from exit by non-daemon data-transfer threads
authorrfield
Mon, 26 Sep 2016 13:18:11 -0700
changeset 41163 05d896ec6618
parent 41162 5fc1d6a0d6ae
child 41164 69167c89e68f
8166655: JShell: Process running JShell should not be blocked from exit by non-daemon data-transfer threads Reviewed-by: jlahoda
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DemultiplexInput.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIEventHandler.java
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DemultiplexInput.java	Fri Sep 23 14:37:03 2016 -0700
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/DemultiplexInput.java	Mon Sep 26 13:18:11 2016 -0700
@@ -45,6 +45,7 @@
 
     DemultiplexInput(InputStream input, Map<String, OutputStream> io, Iterable<OutputStream> closeList) {
         super("output reader");
+        setDaemon(true);
         this.delegate = new DataInputStream(input);
         this.io = io;
         this.closeList = closeList;
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIEventHandler.java	Fri Sep 23 14:37:03 2016 -0700
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/execution/JDIEventHandler.java	Mon Sep 26 13:18:11 2016 -0700
@@ -53,6 +53,7 @@
         this.vm = vm;
         this.reportVMExit = reportVMExit;
         this.thread = new Thread(this, "event-handler");
+        this.thread.setDaemon(true);
     }
 
     /**