if (trace) log.tracef("RL acquired for '%s'", key);
}
}
public boolean acquireLock(Object key, boolean exclusive, long millis) {
ReentrantReadWriteLock lock = getLock(key);
try {
if (exclusive) {
boolean success = lock.writeLock().tryLock(millis, TimeUnit.MILLISECONDS);
if (success && trace) log.tracef("WL acquired for '%s'", key);
return success;
} else {
boolean success = lock.readLock().tryLock(millis, TimeUnit.MILLISECONDS);
if (success && trace) log.tracef("RL acquired for '%s'", key);
return success;
}
} catch (InterruptedException e) {
log.interruptedAcquiringLock(millis, e);