Skip to content

Commit 6907727

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Fix AtomicBitFieldContainer::TryClearIgnoreRace actually ignore on Clang.
TEST=tsan Bug: #57083 Change-Id: I0233a82f176aa357c0ae3a1bfb63358471f3b4e4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394663 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent 5297291 commit 6907727

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runtime/vm/bitfield.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "platform/assert.h"
1111
#include "platform/atomic.h"
1212
#include "platform/globals.h"
13+
#include "platform/no_tsan.h"
1314
#include "platform/thread_sanitizer.h"
1415
#include "platform/utils.h"
1516

@@ -114,9 +115,9 @@ class AtomicBitFieldContainer {
114115
}
115116

116117
template <class TargetBitField>
117-
NO_SANITIZE_THREAD bool TryClearIgnoreRace() {
118+
bool TryClearIgnoreRace() {
118119
T mask = ~TargetBitField::encode(true);
119-
T old_field = field_.fetch_and(mask, std::memory_order_relaxed);
120+
T old_field = FetchAndRelaxedIgnoreRace(&field_, mask);
120121
return TargetBitField::decode(old_field);
121122
}
122123

0 commit comments

Comments
 (0)