Explicitly pin a virtual thread before acquiring the JFR string pool monitor because migrating a carrier thread local event writer object onto another carrier thread is impossible.
During event commit, the thread is in a critical section because it has loaded a carrier thread local event writer object. For virtual threads, a contended monitor, such as a synchronized block, is a point where a thread could become unmounted.
A monitor guards the JFR string pool, but remounting a virtual thread onto another carrier is impossible because of the event writer.
Therefore, it's imperative to use explicit pin constructs to prevent unmounting at this location.
During event commit, the thread is in a critical section because it has loaded a carrier thread local event writer object. For virtual threads, a contended monitor, such as a synchronized block, is a point where a thread could become unmounted.
A monitor guards the JFR string pool, but remounting a virtual thread onto another carrier is impossible because of the event writer.
Therefore, it's imperative to use explicit pin constructs to prevent unmounting at this location.
- relates to
-
JDK-8338745 Intrinsify Continuation.pin() and Continuation.unpin()
- Resolved
- links to
-
Commit(master) openjdk/jdk/69bd227e
-
Review(master) openjdk/jdk/20588