Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/xrpl/basics/IntrusiveRefCounts.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
}

if (refCounts.compare_exchange_weak(
prevIntVal, nextIntVal, std::memory_order_release))
prevIntVal, nextIntVal, std::memory_order_acq_rel))
{
// Can't be in partial destroy because only decrementing the strong
// count to zero can start a partial destroy, and that can't happen
Expand Down Expand Up @@ -351,7 +351,7 @@
}
}
if (refCounts.compare_exchange_weak(
prevIntVal, nextIntVal, std::memory_order_release))
prevIntVal, nextIntVal, std::memory_order_acq_rel))
{
XRPL_ASSERT(
(!(prevIntVal & partialDestroyStartedMask)),
Expand All @@ -374,15 +374,15 @@
// This case should only be hit if the partialDestroyStartedBit is
// set non-atomically (and even then very rarely). The code is kept
// in case we need to set the flag non-atomically for perf reasons.
refCounts.wait(prevIntVal, std::memory_order_acq_rel);
refCounts.wait(prevIntVal, std::memory_order_acquire);

Check warning on line 377 in include/xrpl/basics/IntrusiveRefCounts.h

View check run for this annotation

Codecov / codecov/patch

include/xrpl/basics/IntrusiveRefCounts.h#L377

Added line #L377 was not covered by tests
prevIntVal = refCounts.load(std::memory_order_acquire);
prev = RefCountPair{prevIntVal};
}
if (!prev.partialDestroyFinishedBit)
{
// partial destroy MUST finish before running a full destroy (when
// using weak pointers)
refCounts.wait(prevIntVal - weakDelta, std::memory_order_acq_rel);
refCounts.wait(prevIntVal - weakDelta, std::memory_order_acquire);
}
return ReleaseWeakRefAction::destroy;
}
Expand All @@ -396,7 +396,7 @@
auto desiredValue = RefCountPair{2, 1}.combinedValue();

while (!refCounts.compare_exchange_weak(
curValue, desiredValue, std::memory_order_release))
curValue, desiredValue, std::memory_order_acq_rel))
{
RefCountPair const prev{curValue};
if (!prev.strong)
Expand Down
Loading