コード例 #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();
   }
 }