提交 5e4c6f07 authored 作者: Andrei Tokar's avatar Andrei Tokar

just a comment

上级 c5523965
...@@ -956,6 +956,9 @@ public class MVStore implements AutoCloseable { ...@@ -956,6 +956,9 @@ public class MVStore implements AutoCloseable {
} }
private void closeStore(boolean normalShutdown) { private void closeStore(boolean normalShutdown) {
// If any other thead have already initiated closure procedure,
// isClosed() would wait until closure is done and then we jump out of the loop.
// This is a subtle difference between !isClosed() and isOpen().
while (!isClosed()) { while (!isClosed()) {
if (state.compareAndSet(STATE_OPEN, STATE_STOPPING)) { if (state.compareAndSet(STATE_OPEN, STATE_STOPPING)) {
try { try {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论