diff --git a/runtime/j9vm/javanextvmi.cpp b/runtime/j9vm/javanextvmi.cpp index 97f9fe4c450..a50c0b07665 100644 --- a/runtime/j9vm/javanextvmi.cpp +++ b/runtime/j9vm/javanextvmi.cpp @@ -274,10 +274,10 @@ enterVThreadTransitionCritical(J9VMThread *currentThread, jobject thread) while(!objectAccessBarrier.inlineMixedObjectCompareAndSwapU64(currentThread, threadObj, vm->virtualThreadInspectorCountOffset, 0, (U_64)-1)) { /* Thread is being inspected or unmounted, wait. */ - vmFuncs->internalExitVMToJNI(currentThread); + vmFuncs->internalReleaseVMAccess(currentThread); VM_AtomicSupport::yieldCPU(); /* After wait, the thread may suspend here. */ - vmFuncs->internalEnterVMFromJNI(currentThread); + vmFuncs->internalAcquireVMAccess(currentThread); threadObj = J9_JNI_UNWRAP_REFERENCE(thread); } } diff --git a/runtime/vm/ContinuationHelpers.cpp b/runtime/vm/ContinuationHelpers.cpp index e88f7e7652c..2b5931b4fda 100644 --- a/runtime/vm/ContinuationHelpers.cpp +++ b/runtime/vm/ContinuationHelpers.cpp @@ -539,10 +539,10 @@ acquireVThreadInspector(J9VMThread *currentThread, jobject thread, BOOLEAN spin) vthreadInspectorCount = J9OBJECT_I64_LOAD(currentThread, threadObj, vm->virtualThreadInspectorCountOffset); if (vthreadInspectorCount < 0) { /* Thread is in transition, wait. */ - vmFuncs->internalExitVMToJNI(currentThread); + vmFuncs->internalReleaseVMAccess(currentThread); VM_AtomicSupport::yieldCPU(); /* After wait, the thread may suspend here. */ - vmFuncs->internalEnterVMFromJNI(currentThread); + vmFuncs->internalAcquireVMAccess(currentThread); if (spin) { goto retry; } else {