mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 08:44:27 +00:00
[vm] Fix one race reported in DEBUG+TSAN mode
The SafepointHandler::IsOwnedByTheThread() is used in a few ASSERT()/RELEASE_ASSERT() and accesses the [owner_] field unsynchronized. Issue https://github.com/dart-lang/sdk/issues/47788 TEST=Fixes one race reported when building TSAN in DEBUG mode. Change-Id: I64371265d60c9bb68c299d1c1e8abc2175b33bc8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221331 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
d7e55c4d1b
commit
a3fa6b4c52
1 changed files with 1 additions and 0 deletions
|
@ -76,6 +76,7 @@ class SafepointHandler {
|
|||
void BlockForSafepoint(Thread* T);
|
||||
|
||||
bool IsOwnedByTheThread(Thread* thread) {
|
||||
MonitorLocker ml(threads_lock());
|
||||
for (intptr_t level = 0; level < SafepointLevel::kNumLevels; ++level) {
|
||||
if (handlers_[level]->owner_ == thread) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue