RFR: 8288064: Class initialization locking [v2]

David Holmes dholmes at openjdk.java.net
Wed Jun 15 06:29:54 UTC 2022


On Wed, 15 Jun 2022 03:28:36 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Use a native JVM monitor and state for mutual exclusion for class linking and initialization.  See CR for more details.
>> Tested with tier1-8. tiers 1-4 on Oracle supported platforms and 5-8 on linux-x64-debug.  There isn't any platform dependent code in this change.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review comments from David Holmes.

src/hotspot/share/oops/instanceKlass.hpp line 547:

> 545:   bool is_in_error_state() const           { return init_state() == initialization_error; }
> 546:   bool is_reentrant_initialization(Thread *thread) { return thread == _init_thread; }
> 547:   bool is_reentrant_linking(Thread *thread)        { return thread == _init_thread; }

Sorry Coleen when I asked for this I thought these queries included the state check, but now I see the state is checked separately. You may as well just have a single simple query `is_init_thread(JavaThread* current)`.
And wherever we set the `_init_thread` we should have an assert that it is NULL (if not already done). Thanks.

-------------

PR: https://git.openjdk.org/jdk/pull/9141


More information about the serviceability-dev mailing list