}
public void acquireProcessingLock(boolean exclusive, long timeout, TimeUnit timeUnit) throws TimeoutException {
Lock lock = exclusive ? processingLock.writeLock() : processingLock.readLock();
try {
if (!lock.tryLock(timeout, timeUnit))
throw new TimeoutException(format("%s could not obtain %s processing lock after %s. Locks in question are %s and %s", currentThread().getName(), exclusive ? "exclusive" : "shared", prettyPrintTime(timeout, timeUnit), processingLock.readLock(), processingLock.writeLock()));
// log.info("Acquired processing lock xcl = %s. Locks are %s and %s", exclusive, processingLock.readLock(), processingLock.writeLock());
} catch (InterruptedException ie) {
currentThread().interrupt();
}