Files
sdk/runtime/platform/no_tsan.cc
T
Ryan Macnak 9e28e19002 [test] Synthetic versions of the mutator-marker race.
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>
2024-10-24 03:24:08 +00:00

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