Skip to content

Commit 3cf5f17

Browse files
Fix @Uninterruptible on VMThreads.lockThreadMutexInNativeCode().
1 parent 9114b53 commit 3cf5f17

File tree

1 file changed

+8
-7
lines changed
  • substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread

1 file changed

+8
-7
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/VMThreads.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@
2424
*/
2525
package com.oracle.svm.core.thread;
2626

27-
import com.oracle.svm.core.locks.VMLockSupport;
28-
import jdk.graal.compiler.api.directives.GraalDirectives;
29-
import jdk.graal.compiler.api.replacements.Fold;
30-
import jdk.graal.compiler.replacements.ReplacementsUtil;
31-
import jdk.graal.compiler.replacements.nodes.AssertionNode;
3227
import org.graalvm.nativeimage.CurrentIsolate;
3328
import org.graalvm.nativeimage.ImageSingletons;
3429
import org.graalvm.nativeimage.Isolate;
@@ -55,6 +50,7 @@
5550
import com.oracle.svm.core.jdk.UninterruptibleUtils;
5651
import com.oracle.svm.core.jdk.UninterruptibleUtils.AtomicWord;
5752
import com.oracle.svm.core.locks.VMCondition;
53+
import com.oracle.svm.core.locks.VMLockSupport;
5854
import com.oracle.svm.core.locks.VMMutex;
5955
import com.oracle.svm.core.log.Log;
6056
import com.oracle.svm.core.nodes.CFunctionEpilogueNode;
@@ -68,6 +64,11 @@
6864
import com.oracle.svm.core.util.UnsignedUtils;
6965
import com.oracle.svm.core.util.VMError;
7066

67+
import jdk.graal.compiler.api.directives.GraalDirectives;
68+
import jdk.graal.compiler.api.replacements.Fold;
69+
import jdk.graal.compiler.replacements.ReplacementsUtil;
70+
import jdk.graal.compiler.replacements.nodes.AssertionNode;
71+
7172
/**
7273
* Utility methods for the manipulation and iteration of {@link IsolateThread}s.
7374
*/
@@ -407,12 +408,12 @@ public static boolean wasStartedByCurrentIsolate(IsolateThread thread) {
407408
return StartedByCurrentIsolate.getAddress(thread).readByte(0) != 0;
408409
}
409410

410-
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
411+
@Uninterruptible(reason = "Thread locks/holds the THREAD_MUTEX.", callerMustBe = true)
411412
static void lockThreadMutexInNativeCode() {
412413
lockThreadMutexInNativeCode(false);
413414
}
414415

415-
@Uninterruptible(reason = "Called from uninterruptible code.")
416+
@Uninterruptible(reason = "Thread locks/holds the THREAD_MUTEX.", callerMustBe = true)
416417
@NeverInline("Must not be inlined in a caller that has an exception handler: We only support InvokeNode and not InvokeWithExceptionNode between a CFunctionPrologueNode and CFunctionEpilogueNode.")
417418
private static void lockThreadMutexInNativeCode(boolean unspecifiedOwner) {
418419
CFunctionPrologueNode.cFunctionPrologue(StatusSupport.STATUS_IN_NATIVE);

0 commit comments

Comments
 (0)