Make VanillaChronicleHash.close() to wait until concurrent threads accessing the hash finish their work and don't permit new threads to come while close() is in progress and after that

This commit is contained in:
leventov
2016-07-17 23:25:49 +07:00
parent b3c1f7b1e2
commit 7ada09a8dc
12 changed files with 322 additions and 32 deletions
@@ -52,7 +52,7 @@ public final class BigSegmentHeader implements SegmentHeader {
* Previously this value was 2 seconds, but GC pauses often take more time that shouldn't
* result to IllegalStateException.
*/
private static final int LOCK_TIMEOUT_SECONDS = 60;
public static final int LOCK_TIMEOUT_SECONDS = 60;
private static RuntimeException deadLock() {
return new RuntimeException("Failed to acquire the lock in " + LOCK_TIMEOUT_SECONDS +