Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c79af46

Browse files
committedMar 4, 2025·
Reorder mutex enter / vmaccess, add XX flag check
Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
1 parent 56c15ee commit c79af46

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎runtime/vm/ContinuationHelpers.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -858,10 +858,16 @@ takeVirtualThreadListToUnblock(J9VMThread *currentThread, J9JavaVM *vm)
858858
jobject result = NULL;
859859
J9InternalVMFunctions const * const vmFuncs = vm->internalVMFunctions;
860860

861+
if (J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags3, J9_EXTENDED_RUNTIME3_YIELD_PINNED_CONTINUATION)
862+
|| (NULL == vm->blockedContinuations)
863+
) {
864+
return NULL;
865+
}
866+
867+
omrthread_monitor_enter(vm->blockedVirtualThreadsMutex);
861868
vmFuncs->internalEnterVMFromJNI(currentThread);
862869
while (NULL == unblockedList) {
863870
if (NULL != vm->blockedContinuations) {
864-
omrthread_monitor_enter(vm->blockedVirtualThreadsMutex);
865871
restart:
866872
J9VMContinuation *listHead = vm->blockedContinuations;
867873
J9VMContinuation *next = NULL;

0 commit comments

Comments
 (0)
Please sign in to comment.