提交 fe7ae59d authored 作者: Thomas Mueller's avatar Thomas Mueller

Wait at most 100 ms at a time

上级 5758f584
...@@ -97,11 +97,17 @@ public class WriterThread implements Runnable { ...@@ -97,11 +97,17 @@ public class WriterThread implements Runnable {
// wait 0 mean wait forever, which is not what we want // wait 0 mean wait forever, which is not what we want
wait = Constants.MIN_WRITE_DELAY; wait = Constants.MIN_WRITE_DELAY;
} }
int w = wait;
while (!stop && w >= 0) {
// only wait 100 ms at a time
int n = Math.min(w, 100);
try { try {
Thread.sleep(wait); Thread.sleep(n);
} catch (InterruptedException e) { } catch (InterruptedException e) {
// ignore // ignore
} }
w -= n;
}
} }
databaseRef = null; databaseRef = null;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论