[Fix] First try lock, before trying with timeout
This commit is contained in:
parent
89e11a01aa
commit
eacec9a9ac
|
@ -124,7 +124,7 @@ public class DefaultLockHandler implements LockHandler {
|
||||||
throws StrolchLockException {
|
throws StrolchLockException {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (!tuple.getFirst().tryLock() || !tuple.getFirst().tryLock(tryLockTime, timeUnit)) {
|
if (!tuple.getFirst().tryLock() && !tuple.getFirst().tryLock(tryLockTime, timeUnit)) {
|
||||||
String msg = "Thread {0} failed to acquire lock after {1}s for {2}"; //$NON-NLS-1$
|
String msg = "Thread {0} failed to acquire lock after {1}s for {2}"; //$NON-NLS-1$
|
||||||
msg = MessageFormat
|
msg = MessageFormat
|
||||||
.format(msg, Thread.currentThread().getName(), timeUnit.toSeconds(tryLockTime), locator);
|
.format(msg, Thread.currentThread().getName(), timeUnit.toSeconds(tryLockTime), locator);
|
||||||
|
|
Loading…
Reference in New Issue