Skip to content

Commit de946e9

Browse files
committed
[Hack] Only unlock lock when actually held by current thread
There’s something else wrong here, but I can’t run things locally, so, let’s go with this for now. Signed-off-by: Stefan Marr <[email protected]>
1 parent 8cf4566 commit de946e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/som/primitives/threading/MutexPrimitives.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ public abstract static class UnlockPrim extends UnaryExpressionNode {
8282
@TruffleBoundary
8383
@Specialization
8484
public static final ReentrantLock unlock(final ReentrantLock lock) {
85-
lock.unlock();
85+
if (lock.isHeldByCurrentThread()) {
86+
lock.unlock();
87+
}
8688
return lock;
8789
}
8890

0 commit comments

Comments
 (0)