RFR: 8367013: Add Atomic<T> to package/replace idiom of volatile var plus AtomicAccess:: operations [v6]

Kim Barrett kbarrett at openjdk.org
Tue Nov 11 20:43:15 UTC 2025


On Tue, 11 Nov 2025 11:32:48 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 20 additional commits since the last revision:
>> 
>>  - Merge branch 'master' into atomic-template-tag-select
>>  - remove AtomicNextAccess and uses
>>  - use type_traits wrapper in new code
>>  - Merge branch 'master' into atomic-template-tag-select
>>  - more naming updates
>>  - rename relaxed_store => store_relaxed
>>  - default construct translated atomic without SFINAE
>>  - Merge branch 'master' into atomic-template-tag-select
>>  - Merge branch 'master' into atomic-template-tag-select
>>  - add reference to gcc bug we're working around
>>  - ... and 10 more: https://git.openjdk.org/jdk/compare/8ab17707...da58d0d2
>
> src/hotspot/share/runtime/atomic.hpp line 276:
> 
>> 274:   T compare_exchange(T compare_value, T new_value,
>> 275:                      atomic_memory_order order = memory_order_conservative) {
>> 276:     return AtomicAccess::cmpxchg(value_ptr(), compare_value, new_value);
> 
> Bug: This isn't providing the `order` to `cmpxchg`

Yikes! Thanks for spotting these.  Fixed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27539#discussion_r2515723808


More information about the hotspot-dev mailing list