Skip to content

Commit a350fb7

Browse files
authored
Merge pull request swiftlang#33615 from mikeash/fix-concurrenthashmap-memory-order
2 parents d71d92e + 6467827 commit a350fb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Runtime/Concurrent.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ template <class ElemTy> struct ConcurrentReadableHashMap {
684684
/// Free all the arrays in the free lists if there are no active readers. If
685685
/// there are active readers, do nothing.
686686
void deallocateFreeListIfSafe() {
687-
if (ReaderCount.load(std::memory_order_relaxed) == 0)
687+
if (ReaderCount.load(std::memory_order_acquire) == 0)
688688
deallocateFreeList();
689689
}
690690

@@ -857,7 +857,7 @@ template <class ElemTy> struct ConcurrentReadableHashMap {
857857
ElemTy *elements2;
858858
do {
859859
elements = Elements.load(std::memory_order_acquire);
860-
indices = Indices.load(SWIFT_MEMORY_ORDER_CONSUME);
860+
indices = Indices.load(std::memory_order_acquire);
861861
elementCount = ElementCount.load(std::memory_order_acquire);
862862
elements2 = Elements.load(std::memory_order_acquire);
863863
} while (elements != elements2);

0 commit comments

Comments
 (0)