提交 7eb313c7 编写于 作者: A art

6828273: javax/swing/system/6799345/TestShutdown.java test fails with RuntimeException.

Reviewed-by: anthony, dcherepanov
上级 adc3756d
...@@ -377,22 +377,22 @@ public final class XToolkit extends UNIXToolkit implements Runnable { ...@@ -377,22 +377,22 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
init(); init();
XWM.init(); XWM.init();
SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME); SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME);
toolkitThread = new Thread(this, "AWT-XAWT");
toolkitThread.setPriority(Thread.NORM_PRIORITY + 1); PrivilegedAction<Thread> action = new PrivilegedAction() {
toolkitThread.setDaemon(true); public Thread run() {
ThreadGroup mainTG = (ThreadGroup)AccessController.doPrivileged( ThreadGroup currentTG = Thread.currentThread().getThreadGroup();
new PrivilegedAction() {
public Object run() {
ThreadGroup currentTG =
Thread.currentThread().getThreadGroup();
ThreadGroup parentTG = currentTG.getParent(); ThreadGroup parentTG = currentTG.getParent();
while (parentTG != null) { while (parentTG != null) {
currentTG = parentTG; currentTG = parentTG;
parentTG = currentTG.getParent(); parentTG = currentTG.getParent();
} }
return currentTG; Thread thread = new Thread(currentTG, XToolkit.this, "AWT-XAWT");
thread.setPriority(Thread.NORM_PRIORITY + 1);
thread.setDaemon(true);
return thread;
} }
}); };
toolkitThread = AccessController.doPrivileged(action);
toolkitThread.start(); toolkitThread.start();
} }
} }
......
...@@ -59,7 +59,7 @@ public class TestShutdown ...@@ -59,7 +59,7 @@ public class TestShutdown
while (!appcontextInitDone) while (!appcontextInitDone)
{ {
Thread.sleep(500); Thread.sleep(1000);
} }
targetAppContext.dispose(); targetAppContext.dispose();
...@@ -146,7 +146,6 @@ public class TestShutdown ...@@ -146,7 +146,6 @@ public class TestShutdown
startGUI(); startGUI();
} }
}); });
stk.realSync();
// start multiple SwingWorkers // start multiple SwingWorkers
while (!Thread.interrupted()) while (!Thread.interrupted())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册