RFR: 8369631: Assess and remedy any unsafe usage of the sr_semaphore Semaphore in the Posix signal code [v2]
David Holmes
dholmes at openjdk.org
Wed Oct 15 12:26:55 UTC 2025
On Wed, 15 Oct 2025 02:03:43 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> David Holmes has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Switch to DeferredStatic per Kim's request
>
> src/hotspot/os/posix/signals_posix.cpp line 356:
>
>> 354: // Initialize signal semaphore
>> 355: int sem_count = 0;
>> 356: sig_semaphore.initialize(sem_count);
>
> Just `sig_semaphore.initialize();` should be work. And the variable declaration looks kind of odd in context.
I was not sure how the "magic" of initialization worked in this case with default constructor arguments - plus I wanted to be explicit about the initial count. Unfortunately the template requires a reference hence the local was introduced - if there is a better way to do this please advise me.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27762#discussion_r2432357823
More information about the hotspot-runtime-dev
mailing list