Enable exclusive locks on Windows environments by default, https://github.com/OpenHFT/Chronicle-Map/issues/292

This commit is contained in:
Ivan Rakov
2021-06-17 15:55:21 +03:00
parent 9f4fd024eb
commit a7f884ec24
2 changed files with 8 additions and 12 deletions
@@ -21,7 +21,7 @@ public final class FileLockUtil {
*/
private static final String DISABLE_LOCKING = "chronicle.map.disable.locking";
private static final ConcurrentHashMap<File, FileLockReference> FILE_LOCKS = new ConcurrentHashMap<>();
private static final boolean USE_EXCLUSIVE_LOCKING = !OS.isWindows() && !Jvm.getBoolean(DISABLE_LOCKING);
private static final boolean USE_EXCLUSIVE_LOCKING = !Jvm.getBoolean(DISABLE_LOCKING);
private static final boolean USE_SHARED_LOCKING = !OS.isWindows() && !Jvm.getBoolean(DISABLE_LOCKING) &&
!"shared".equalsIgnoreCase(System.getProperty(DISABLE_LOCKING));
private static final AtomicBoolean LOCK_WARNING_PRINTED = new AtomicBoolean();