On Wed, 13 May 2026 08:25:16 GMT, David Holmes <[email protected]> wrote:
>> Kevin Walls has updated the pull request incrementally with two additional
>> commits since the last revision:
>>
>> - Use accessor to access _mutex
>> - remove revival 'status' field
>
> src/hotspot/os/posix/mutex_posix.hpp line 100:
>
>> 98:
>> 99: void clear_for_revive() {
>> 100: pthread_mutex_init(mutex(), nullptr);
>
> No this is not valid. It is UB to reinitialize an initialized mutex. You
> would have to call `pthread_mutex_destroy()`, but it is UB to destroy a
> locked mutex so that don't work either.
>
> You will need to do something at a higher-level that turns locking into a
> no-op when running in the revived VMThread.
After some offline discussion zeroing the memory before doing the re-init
should be okay.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31011#discussion_r3237464299