-
Enhancement
-
Resolution: Fixed
-
P4
-
16
-
b17
The comment on JavaThread::java_suspend_self_with_safepoint_check() should be updated [1]
The comment states "Because this thread is external suspended the safepoint code will count it as at a safepoint, regardless of what its actual current thread-state is"
AfterJDK-8252414 this is not the case anymore. Suspend flags are not regarded when deciding if a thread is safepoint/handshake safe.
The statement "However, not all initial-states are allowed when performing a safepoint check, as we should never be blocking at a safepoint whilst in those states. Of these 'bad' states only _thread_in_native is possible when executing this code (based on our two callers)" does not name all of the problematic states. This can cause uncertainty with the reader. The comment should point to SafepointSynchronize::block() where the 'good' states are enumerated in the switch statement [2].
[1] https://github.com/openjdk/jdk/blob/1c84cfa2364fa18fc028df89bdc4de207365784f/src/hotspot/share/runtime/thread.cpp#L2593
[2] States that are allowed when performing a safepoint check
https://github.com/openjdk/jdk/blob/a9993f9464a724637b3d38bd2f6caedf884d3e0b/src/hotspot/share/runtime/safepoint.cpp#L715
The comment states "Because this thread is external suspended the safepoint code will count it as at a safepoint, regardless of what its actual current thread-state is"
After
The statement "However, not all initial-states are allowed when performing a safepoint check, as we should never be blocking at a safepoint whilst in those states. Of these 'bad' states only _thread_in_native is possible when executing this code (based on our two callers)" does not name all of the problematic states. This can cause uncertainty with the reader. The comment should point to SafepointSynchronize::block() where the 'good' states are enumerated in the switch statement [2].
[1] https://github.com/openjdk/jdk/blob/1c84cfa2364fa18fc028df89bdc4de207365784f/src/hotspot/share/runtime/thread.cpp#L2593
[2] States that are allowed when performing a safepoint check
https://github.com/openjdk/jdk/blob/a9993f9464a724637b3d38bd2f6caedf884d3e0b/src/hotspot/share/runtime/safepoint.cpp#L715
- relates to
-
JDK-8252414 Redundant suspend check when determining if a java thread is safe
- Resolved