On Mon, 11 Aug 2025 15:55:02 GMT, Viktor Klang <vkl...@openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Add a new method to StableValueImpl for improved speed
>
> src/java.base/share/classes/jdk/internal/lang/stable/StableValueImpl.java 
> line 174:
> 
>> 172:                     // Reduce the counter and if it reaches zero, clear 
>> the reference
>> 173:                     // to the underlying holder.
>> 174:                     underlyingHolder.countDown();
> 
> Doesn't the code here imply that if the underlying supplier/function etc 
> throws an exception, the underlyingHolder won't get counted down, and will 
> leak?

No, because the stable value doesn’t get set in that case, so the 
supplier/function will be called again.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25878#discussion_r2267601572

Reply via email to