RFR: 7903519 : jtreg/jtharness is missing features for basic crash testing [v4]
Vladimir Sitnikov
vsitnikov at openjdk.org
Thu Dec 14 09:20:00 UTC 2023
On Thu, 14 Dec 2023 08:42:19 GMT, andrlos <duke at openjdk.org> wrote:
>> Please check https://shipilev.net/blog/2014/safe-public-construction/#_safe_publication
>>
>> The code reads `statusModifier` without synchronization, and it might observe uninitialized object. In other words, a `non-null` value does not mean it was fully initialized.
>
> @vlsi it just occured to me that I can initialize the `statusModifier` during the initialization of the `Script` instance, therefore there should be no problem reading it from multiple threads.. WDYT? Sorry for throwing half witted ideas out here.. and I read the blog you shared I can see why you dont like the current approach and I agree it must be altered.
Initializing it along with `Script` initialization sounds reasonable to me, and it might indeed simplify the code.
For instance, you could treat `null` implementation as a missing one, so you don not need to have "default implementation" in the code.
-------------
PR Review Comment: https://git.openjdk.org/jtharness/pull/57#discussion_r1426446223
More information about the jtharness-dev
mailing list