private static final boolean isOldClient(File indexDirectory) { clientsLock.r.lock(); try { return OLD_CLIENTS.contains(indexDirectory); } finally { clientsLock.r.unlock(); } }
private static void unlockClientDir(File clientDir, Client newClient) { clientsLock.w.lock(); try { if (newClient != null) CLIENTS.put(clientDir, newClient); OLD_CLIENTS.remove(clientDir); } finally { clientsLock.w.unlock(); } }
private static void lockClientDir(File clientDir) { clientsLock.w.lock(); try { CLIENTS.remove(clientDir); OLD_CLIENTS.add(clientDir); } finally { clientsLock.w.unlock(); } }