From bdb50cab79056bb2ac9fe1ba0cf0f237317052da Mon Sep 17 00:00:00 2001 From: Xiaowei Lu Date: Tue, 3 Aug 2021 12:23:14 +0000 Subject: [PATCH] 8270347: ZGC: Adopt release-acquire ordering for forwarding table access Co-authored-by: Hao Tang Reviewed-by: eosterlund, pliden --- src/hotspot/share/gc/z/zForwarding.inline.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hotspot/share/gc/z/zForwarding.inline.hpp b/src/hotspot/share/gc/z/zForwarding.inline.hpp index 31bf7292996..9207dfdb012 100644 --- a/src/hotspot/share/gc/z/zForwarding.inline.hpp +++ b/src/hotspot/share/gc/z/zForwarding.inline.hpp @@ -137,7 +137,7 @@ inline uintptr_t ZForwarding::insert(uintptr_t from_index, uintptr_t to_offset, const ZForwardingEntry old_entry; // Empty for (;;) { - const ZForwardingEntry prev_entry = Atomic::cmpxchg(entries() + *cursor, old_entry, new_entry); + const ZForwardingEntry prev_entry = Atomic::cmpxchg(entries() + *cursor, old_entry, new_entry, memory_order_release); if (!prev_entry.populated()) { // Success return to_offset;