Merge
authordsamersoff
Fri, 29 Jan 2016 14:59:24 +0000
changeset 35891 875dacc9317e
parent 35888 d737e343520a (current diff)
parent 35890 e41d511fd43e (diff)
child 35893 5231084bd1f8
Merge
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java	Fri Jan 29 14:41:07 2016 +0100
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java	Fri Jan 29 14:59:24 2016 +0000
@@ -141,15 +141,19 @@
         return;
     }
 
+    // Create frame first, to catch any GUI creation issues
+    // before we initialize agent
+
+    frame = new JFrame("HSDB - HotSpot Debugger");
+    frame.setSize(800, 600);
+    frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+    frame.addWindowListener(new CloseUI());
+
     agent = new HotSpotAgent();
     workerThread = new WorkerThread();
     attachMenuItems = new java.util.ArrayList();
     detachMenuItems = new java.util.ArrayList();
 
-    frame = new JFrame("HSDB - HotSpot Debugger");
-    frame.setSize(800, 600);
-    frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
-    frame.addWindowListener(new CloseUI());
 
     JMenuBar menuBar = new JMenuBar();
 
--- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java	Fri Jan 29 14:41:07 2016 +0100
+++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java	Fri Jan 29 14:59:24 2016 +0000
@@ -35,7 +35,11 @@
   public WorkerThread() {
     mqb = new MessageQueueBackend();
     mq = mqb.getFirstQueue();
-    new Thread(new MainLoop()).start();
+
+    // Enable to terminate this worker during runnning by daemonize.
+    Thread mqthread = new Thread(new MainLoop());
+    mqthread.setDaemon(true);
+    mqthread.start();
   }
 
   /** Runs the given Runnable in the thread represented by this