Skip to content

Commit 82f8a10

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Take only a read lock during Field::SetStaticValue.
It is safe for multiple isolates to set their values concurrently. Only growth of the field tables needs to be excluded by the write lock. A storm of such setters are invoked as part of core library initialization during isolate spawning. TEST=ci, tsan Change-Id: I4677e33ee80bb06d261ada2ae9d6b71c94fde611 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405400 Commit-Queue: Ryan Macnak <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent 8a1010f commit 82f8a10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

runtime/vm/object.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13330,7 +13330,7 @@ void Field::SetStaticValue(const Object& value) const {
1333013330
const intptr_t id = field_id();
1333113331
ASSERT(id >= 0);
1333213332

13333-
SafepointWriteRwLocker ml(thread, thread->isolate_group()->program_lock());
13333+
SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock());
1333413334
thread->isolate()->field_table()->SetAt(id, value.ptr());
1333513335
}
1333613336

0 commit comments

Comments
 (0)