[Fix] First try lock, before trying with timeout

This commit is contained in:
Robert von Burg 2020-06-17 19:25:09 +02:00
parent 89e11a01aa
commit eacec9a9ac
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ public class DefaultLockHandler implements LockHandler {
throws StrolchLockException {
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$
msg = MessageFormat
.format(msg, Thread.currentThread().getName(), timeUnit.toSeconds(tryLockTime), locator);