Skip to content

Commit 18233c1

Browse files
committed
Fix logic in tryLock()
1 parent 213a466 commit 18233c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/apache/accumulo/core/fate/zookeeper/DistributedReadWriteLock.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public boolean tryLock() {
182182
@Override
183183
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
184184
Timer timer = Timer.startNew();
185-
while (timer.hasElapsed(time, unit)) {
185+
while (!timer.hasElapsed(time, unit)) {
186186
if (tryLock()) {
187187
return true;
188188
}

0 commit comments

Comments
 (0)