Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Luca Kellermann
On Thu, 13 Mar 2025 09:45:22 GMT, Per Minborg wrote: >> src/java.base/share/classes/jdk/internal/lang/stable/StableValueImpl.java >> line 128: >> >>> 126: final T newValue = supplier.get(); >>> 127: // The mutex is reentrant so we need to check if the value >>> was actu

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Luca Kellermann
On Mon, 10 Mar 2025 18:11:23 GMT, Per Minborg wrote: > Implement JEP 502. > > The PR passes tier1-tier3 tests. src/java.base/share/classes/java/lang/StableValue.java line 79: > 77: *logger.trySet(Logger.create(Component.class)); > 78: *} > 79: * return logger.orT

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-13 Thread Luca Kellermann
On Wed, 12 Mar 2025 08:16:50 GMT, Per Minborg wrote: >> The nulling out is only safe if the write to the value is visible when a >> nulled-out function is visible. I think SV can ensure this, but an >> implementation can easily go wrong trying to do this. (Also `orElseSet` does >> not NPE if t