[vm] Fix AtomicBitFieldContainer::TryClearIgnoreRace actually ignore on Clang.
TEST=tsan Bug: https://github.com/dart-lang/sdk/issues/57083 Change-Id: I0233a82f176aa357c0ae3a1bfb63358471f3b4e4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394663 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
committed by
Commit Queue
parent
5297291230
commit
69077272cf
@@ -10,6 +10,7 @@
|
||||
#include "platform/assert.h"
|
||||
#include "platform/atomic.h"
|
||||
#include "platform/globals.h"
|
||||
#include "platform/no_tsan.h"
|
||||
#include "platform/thread_sanitizer.h"
|
||||
#include "platform/utils.h"
|
||||
|
||||
@@ -114,9 +115,9 @@ class AtomicBitFieldContainer {
|
||||
}
|
||||
|
||||
template <class TargetBitField>
|
||||
NO_SANITIZE_THREAD bool TryClearIgnoreRace() {
|
||||
bool TryClearIgnoreRace() {
|
||||
T mask = ~TargetBitField::encode(true);
|
||||
T old_field = field_.fetch_and(mask, std::memory_order_relaxed);
|
||||
T old_field = FetchAndRelaxedIgnoreRace(&field_, mask);
|
||||
return TargetBitField::decode(old_field);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user