if (lockTimeoutMs == -1) {
// Wait indefinitely
lock.acquire();
} else {
if (!lock.tryAcquire(lockTimeoutMs)) {
throw new LockTimeoutException("Timed out acquiring " +
(isShared ? "read" : "write") + "lock for table:" + tableNameStr +
"for:" + purpose + " after " + lockTimeoutMs + " ms.");
}
}
} catch (InterruptedException e) {