RFR: 8288497: add support for JavaThread::is_gc_barrier_detached()
Daniel D.Daugherty
dcubed at openjdk.java.net
Wed Jun 15 16:17:56 UTC 2022
On Wed, 15 Jun 2022 15:44:21 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
> A trivial fix to add support for JavaThread::is_gc_barrier_detached() which allows
> us to add checks to detect failures like:
>
> JDK-8288139 JavaThread touches oop after GC barrier is detached
> https://bugs.openjdk.org/browse/JDK-8288139
>
> This fix along with the fix for JDK-8288139 has been tested in Mach5 Tier[1-8].
> There are no related failures in Mach5 Tier[1-7]; Mach5 Tier8 is still running.
src/hotspot/share/runtime/thread.inline.hpp line 264:
> 262: inline bool JavaThread::is_exiting() const {
> 263: // Use load-acquire so that setting of _terminated by
> 264: // JavaThread::set_terminated() is seen more quickly.
This comment should have been updated when the code in
JavaThread::exit() was refactored into JavaThread::set_terminated().
I'm doing it as part of this fix for clarity.
src/hotspot/share/runtime/thread.inline.hpp line 281:
> 279: inline bool JavaThread::is_terminated() const {
> 280: // Use load-acquire so that setting of _terminated by
> 281: // JavaThread::set_terminated() is seen more quickly.
This comment should have been updated when the code in
JavaThread::exit() was refactored into JavaThread::set_terminated().
I'm doing it as part of this fix for clarity.
src/hotspot/share/services/threadService.cpp line 167:
> 165: if (!thread->is_exiting()) {
> 166: // We did not get here via JavaThread::exit() so current_thread_exiting()
> 167: // was not called, e.g., JavaThread::cleanup_failed_attach_current_thread().
[JDK-8286830](https://bugs.openjdk.org/browse/JDK-8286830) ~HandshakeState should not touch oops
changed JavaThread::exit() so we no longer had a path that called current_thread_exiting()
and another path that did not call current_thread_exiting() so this comment should have
been clarified with that fix. I'm doing it as part of this fix for clarity.
-------------
PR: https://git.openjdk.org/jdk19/pull/20
More information about the hotspot-runtime-dev
mailing list