}
public void acquireProcessingLock(boolean exclusive, long timeout, TimeUnit timeUnit) throws TimeoutException {
Lock lock = exclusive ? processingLock.writeLock() : processingLock.readLock();
try {
if (!lock.tryLock(timeout, timeUnit)) {
if (exclusive) log.debugf("Failed to acquire exclusive processing lock. Read lock holders are %s", debugReadLockHolders);
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()));
}