RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v78]

Alan Bateman alanb at openjdk.org
Fri Apr 25 10:41:19 UTC 2025


On Thu, 24 Apr 2025 10:37:59 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> Implement JEP 502.
>> 
>> The PR passes tier1-tier3 tests.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Make public constuctor private

src/java.base/share/classes/jdk/internal/lang/stable/StableValueImpl.java line 175:

> 173:     private void preventReentry() {
> 174:         if (Thread.holdsLock(this)) {
> 175:             throw new IllegalStateException("Recursive initialization of a stable value is illegal");

I don't know how common it is to use holdsLocks for control flow but just to say that there are several places in the JDK that have to detect reentrancy and some of these are good candidates to use ScopedValues.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2059996394


More information about the core-libs-dev mailing list