Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Acquire VThreadInspector before vmThreadListMutex to avoid deadlock
VirtualThreads.park performs operations in the below order: Set VThreadInspector to -1 and then acquire vmThreadListMutex JVMTI GetThreadState -> ... -> getVMThread follows the below order: Acquire vmThreadListMutex and then spin until VThreadInspector != -1 A deadlock occurs because the order of operations is inconsistent between VirtualThreads.park and JVMTI GetThreadState. To resolve the deadlock, the operations in getVMThread are swapped to match the operations in VirtualThreads.park: Acquire VThreadInspector and then acquire vmThreadListMutex Related: eclipse-openj9#18642 Signed-off-by: Babneet Singh <[email protected]>
- Loading branch information