Update LockableObject.java
This commit is contained in:
parent
9ea4929497
commit
549d8fb8a7
|
@ -35,12 +35,12 @@ public class LockableObject {
|
||||||
public void lock() {
|
public void lock() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
logger.info("locking " + this.toString()); //$NON-NLS-1$
|
|
||||||
if (!this.lock.tryLock(tryLockTime, TimeUnit.MILLISECONDS)) {
|
if (!this.lock.tryLock(tryLockTime, TimeUnit.MILLISECONDS)) {
|
||||||
String msg = "Failed to acquire lock after {0} for {1}"; //$NON-NLS-1$
|
String msg = "Failed to acquire lock after {0} for {1}"; //$NON-NLS-1$
|
||||||
msg = MessageFormat.format(msg, StringHelper.formatMillisecondsDuration(tryLockTime), this.toString());
|
msg = MessageFormat.format(msg, StringHelper.formatMillisecondsDuration(tryLockTime), this.toString());
|
||||||
throw new XmlPersistenceException(msg);
|
throw new XmlPersistenceException(msg);
|
||||||
}
|
}
|
||||||
|
logger.info("locked " + this.toString()); //$NON-NLS-1$
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new XmlPersistenceException("Thread interrupted: " + e.getMessage(), e); //$NON-NLS-1$
|
throw new XmlPersistenceException("Thread interrupted: " + e.getMessage(), e); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue