RFR: 8268638: semaphores of AsyncLogWriter may be broken when JVM is exiting. [v2]
Xin Liu
xliu at openjdk.java.net
Tue Jun 15 06:19:28 UTC 2021
On Tue, 15 Jun 2021 01:56:45 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> I guess I wasn't clear enough.
>>
>> Please do not make any changes to the Semaphore class. This "value" is not needed in general and not needed for your sanity checking.
>>
>> The Semaphore _lock is defined in the AsyncLogWriter class and initialized to 1 so it can be used to mimic a mutual exclusion lock. This does not need to be sanity checked as it is all handled within a small chunk of code. The AsyncLogLocker does not take a semaphore, it is a friend of AsyncLogWriter and accesses _lock directly.
>>
>> Thanks,
>> David
>
> PS. If it were warranted, the way to do your "sanity check" would be to introduce a BinarySemaphore class that always initializes to a count of 1. But we do not need this.
I see. I remove the sanity check.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4479
More information about the hotspot-runtime-dev
mailing list