9e28e19002
TEST=vm/cc/MutatorMarkerRace_* Bug: https://github.com/dart-lang/sdk/issues/56895 Change-Id: I3e3f25b2c43aec09a409377f77c6d2fec287bccb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390263 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
34 lines
927 B
C++
34 lines
927 B
C++
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "platform/no_tsan.h"
|
|
|
|
namespace dart {
|
|
|
|
#if defined(__clang__)
|
|
|
|
#if defined(__has_feature)
|
|
#if __has_feature(thread_sanitizer)
|
|
#error Misconfigured build
|
|
#endif
|
|
#endif
|
|
|
|
uintptr_t FetchAndRelaxedIgnoreRace(std::atomic<uintptr_t>* ptr,
|
|
uintptr_t value) {
|
|
return ptr->fetch_and(value, std::memory_order_relaxed);
|
|
}
|
|
|
|
uintptr_t FetchOrRelaxedIgnoreRace(std::atomic<uintptr_t>* ptr,
|
|
uintptr_t value) {
|
|
return ptr->fetch_or(value, std::memory_order_relaxed);
|
|
}
|
|
|
|
uintptr_t LoadRelaxedIgnoreRace(const std::atomic<uintptr_t>* ptr) {
|
|
return ptr->load(std::memory_order_relaxed);
|
|
}
|
|
|
|
#endif // defined(__clang__)
|
|
|
|
} // namespace dart
|