提交 442790ba 编写于 作者: D dfuchs

8150533: Test java/util/logging/LogManagerAppContextDeadlock.java times out intermittently.

Summary: This is a test bug caused by a Logger being garbage collected too early.
Reviewed-by: darcy
上级 0edfe2ef
......@@ -136,6 +136,7 @@ public class LogManagerAppContextDeadlock {
t1.setDaemon(true);
t1.start();
Thread t2 = new Thread() {
public Object logger;
public void run() {
sem3.release();
try {
......@@ -146,7 +147,10 @@ public class LogManagerAppContextDeadlock {
Thread.interrupted();
}
System.out.println("Logger.getLogger(name).info(name)");
Logger.getLogger(test.name());//.info(name);
// stick the logger in an instance variable to prevent it
// from being garbage collected before the main thread
// calls LogManager.getLogger() below.
logger = Logger.getLogger(test.name());//.info(name);
System.out.println("Done: Logger.getLogger(name).info(name)");
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册