Skip to content

Commit d33d687

Browse files
committed
Use lock instead of tryLock when we should own the lock.
1 parent d77142e commit d33d687

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/truffleruby/core/mutex/ConditionVariableNodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ private void waitInternal(RubyConditionVariable conditionVariable, ReentrantLock
125125
}
126126
} finally {
127127
condLock.unlock();
128+
128129
MutexOperations.internalLockEvenWithException(getContext(), mutexLock, this);
129130
if (holdCount > 1) {
130131
// We know we already hold the lock, so we can skip the rest of the logic at this point.
131132
for (int i = 1; i < holdCount; i++) {
132-
mutexLock.tryLock();
133+
mutexLock.lock();
133134
}
134135
}
135136
}

0 commit comments

Comments
 (0)