Optimize blinear closed file cleanup logic
This commit is contained in:
+3
-5
@@ -459,6 +459,9 @@ public class BufferedLinearRegionFile implements io.nanachiyo0721.shiroha.data.R
|
||||
return;
|
||||
}
|
||||
|
||||
// remove from flusher
|
||||
this.markClosed();
|
||||
|
||||
IOException failure = null;
|
||||
|
||||
// final sync so no buffered data is lost; holding syncLock also guarantees no
|
||||
@@ -473,8 +476,6 @@ public class BufferedLinearRegionFile implements io.nanachiyo0721.shiroha.data.R
|
||||
}
|
||||
|
||||
try {
|
||||
this.markClosed();
|
||||
|
||||
this.swapFileChannel.close();
|
||||
} catch (IOException ex) {
|
||||
if (failure == null) failure = ex;
|
||||
@@ -488,9 +489,6 @@ public class BufferedLinearRegionFile implements io.nanachiyo0721.shiroha.data.R
|
||||
else failure.addSuppressed(e);
|
||||
}
|
||||
|
||||
// finalize
|
||||
this.markClosed();
|
||||
|
||||
if (failure != null) {
|
||||
throw failure;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user