On Wed, 13 May 2026 21:09:40 GMT, David Holmes <[email protected]> wrote:

>> 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.

Thanks David.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31011#discussion_r3241333593

Reply via email to