Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support virtual threads in JVMTI Resume* and Suspend* functions #15903

Merged
merged 1 commit into from
Oct 11, 2022

Commits on Oct 11, 2022

  1. Support virtual threads in JVMTI Resume* and Suspend* functions

    This PR impacts the following JVMTI functions:
    
    - [Resume|Suspend]Thread
    - [Resume|Suspend]ThreadList
    - [Resume|Suspend]AllVirtualThreads
    
    The above functions have been either implemented or updated as per the
    JVMTI doc:
    https://download.java.net/java/early_access/jdk19/docs/specs/jvmti.html
    
    Other changes:
    - Added boolean inspectingLiveVirtualThreadList to synchronize between
    [Resume|Suspend]AllVirtualThreads, JVM_VirtualThreadMountBegin-End and
    JVM_VirtualThreadUnmountBegin-End.
    - If a thread is suspended while waiting on the monitor, then the
    monitor is released after waking up and before invoking
    internalEnterVMFromJNI, where the thread will be halted until resumed.
    After resuming, the monitor is acquired again. This helps avoid
    deadlocks.
    - Added hidden field isSuspendedByJVMTI in VirtualThread to track if the
    thread was suspended in JVMTI. If isSuspendedByJVMTI is non-zero, then
    J9_PUBLIC_FLAGS_HALT_THREAD_JAVA_SUSPEND is set in carrier J9VMThread's
    publicFlags while resetting isSuspendedByJVMTI to zero. During mount,
    this suspends the thread if the thread was unmounted while JVMTI
    suspended it.
    
    Related: eclipse-openj9#15760
    
    Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
    babsingh committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    e0508fe View commit details
    Browse the repository at this point in the history