예제 #1
0
 private static final boolean isOldClient(File indexDirectory) {
   clientsLock.r.lock();
   try {
     return OLD_CLIENTS.contains(indexDirectory);
   } finally {
     clientsLock.r.unlock();
   }
 }
예제 #2
0
 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();
   }
 }
예제 #3
0
 private static void lockClientDir(File clientDir) {
   clientsLock.w.lock();
   try {
     CLIENTS.remove(clientDir);
     OLD_CLIENTS.add(clientDir);
   } finally {
     clientsLock.w.unlock();
   }
 }