提交 3fc719ba authored 作者: Noel Grandin's avatar Noel Grandin

only do this on OSX, on Windows causes spurious test failure

上级 885b3745
...@@ -31,6 +31,7 @@ import java.awt.event.WindowListener; ...@@ -31,6 +31,7 @@ import java.awt.event.WindowListener;
import java.io.IOException; import java.io.IOException;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Locale;
import org.h2.server.ShutdownHandler; import org.h2.server.ShutdownHandler;
import org.h2.util.JdbcUtils; import org.h2.util.JdbcUtils;
import org.h2.util.Tool; import org.h2.util.Tool;
...@@ -352,9 +353,12 @@ ShutdownHandler { ...@@ -352,9 +353,12 @@ ShutdownHandler {
} }
System.gc(); System.gc();
// Mac OS X: Console tool process did not stop on exit // Mac OS X: Console tool process did not stop on exit
for (Thread t : Thread.getAllStackTraces().keySet()) { String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
if (t.getName().startsWith("AWT-")) { if (OS.indexOf("mac") >= 0) {
t.interrupt(); for (Thread t : Thread.getAllStackTraces().keySet()) {
if (t.getName().startsWith("AWT-")) {
t.interrupt();
}
} }
} }
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论