提交 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,11 +353,14 @@ ShutdownHandler { ...@@ -352,11 +353,14 @@ 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
String OS = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH);
if (OS.indexOf("mac") >= 0) {
for (Thread t : Thread.getAllStackTraces().keySet()) { for (Thread t : Thread.getAllStackTraces().keySet()) {
if (t.getName().startsWith("AWT-")) { if (t.getName().startsWith("AWT-")) {
t.interrupt(); t.interrupt();
} }
} }
}
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
// throw new ThreadDeath(); // throw new ThreadDeath();
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论