RFR: 8367013: Add Atomic<T> to package/replace idiom of volatile var plus AtomicAccess:: operations [v6]
Stefan Karlsson
stefank at openjdk.org
Wed Nov 12 07:24:05 UTC 2025
On Tue, 11 Nov 2025 20:32:35 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> src/hotspot/share/runtime/atomic.hpp line 36:
>>
>>> 34: // Atomic<T> is used to declare a variable of type T with atomic access.
>>> 35: //
>>> 36: // The following value types T are supported:
>>
>> It would be nice to explain how enums fit into all this. In offline discussions that question was raised. It would be nice to get that clarified in this comment.
>
> There's a PrimitiveConversions::Translate specialization for enums. I'm not
> sure what more should be done than the existing reference to Translate
> specializations. It's not appropriate to list here all the types for which
> there are such specializations. Something like "such as enum types" could be
> added, but that feels like treating enum as more special here than I think it is.
People know what enums are but there's only a few people that know what PrimitiveConversions::Translate is. Hence my comment. Anyways, I know what PrimitiveConversions::Translate is and I've given my feedback that the comments doesn't help the readers that don't understand this understand how enums fit in. I'll leave it to others react if they don't understand.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27539#discussion_r2517192118
More information about the hotspot-dev
mailing list