Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: runtime/vm/class_table.cc

Issue 2602123002: Fix the following tsan errors: (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/class_table.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_table.cc
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc
index 4ceeb60a5de3c7b45f09dda503f7c3f1003c081a..0094cd5be8d47c3973385dff644e442f283275c0 100644
--- a/runtime/vm/class_table.cc
+++ b/runtime/vm/class_table.cc
@@ -124,9 +124,11 @@ void ClassTable::Register(const Class& cls) {
// Add the vtable for this predefined class into the static vtable registry
// if it has not been setup yet.
cpp_vtable cls_vtable = cls.handle_vtable();
- AtomicOperations::CompareAndSwapWord(&(Object::builtin_vtables_[index]), 0,
- cls_vtable);
- ASSERT(Object::builtin_vtables_[index] == cls_vtable);
+ cpp_vtable old_cls_vtable = AtomicOperations::CompareAndSwapWord(
+ &(Object::builtin_vtables_[index]), 0, cls_vtable);
+ if (old_cls_vtable != 0) {
+ ASSERT(old_cls_vtable == cls_vtable);
+ }
} else {
if (top_ == capacity_) {
// Grow the capacity of the class table.
« no previous file with comments | « runtime/vm/class_table.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698