提交 2d22402e authored 作者: andrei's avatar andrei

Do not copy keySet, since map is frozen with terminated=true

上级 2d4496ca
......@@ -67,13 +67,11 @@ class OnExitDatabaseCloser extends Thread {
}
private static void onShutdown() {
ArrayList<Database> databases;
synchronized(OnExitDatabaseCloser.class) {
terminated = true;
databases = new ArrayList<>(DATABASES.keySet());
}
RuntimeException root = null;
for (Database database : databases) {
for (Database database : DATABASES.keySet()) {
try {
database.close(true);
} catch (RuntimeException e) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论