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

Unified Diff: runtime/vm/symbols.cc

Issue 1717803002: Add a SafepointMutexLocker class so that it is possible to have scopes inside the MutexLocker which… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-code-review Created 4 years, 10 months 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
« runtime/vm/isolate.h ('K') | « runtime/vm/lockers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/symbols.cc
diff --git a/runtime/vm/symbols.cc b/runtime/vm/symbols.cc
index f6735c232dd3bf00f4ec306e6829dec51113fd0d..d35dc6d20e4a5096fdb144f1b2d62334e841bc2a 100644
--- a/runtime/vm/symbols.cc
+++ b/runtime/vm/symbols.cc
@@ -564,6 +564,7 @@ RawString* Symbols::NewSymbol(const StringType& str) {
table.Release();
}
if (symbol.IsNull()) {
+ SafepointMutexLocker ml(isolate->symbols_mutex());
SymbolTable table(zone, isolate->object_store()->symbol_table());
symbol ^= table.InsertNewOrGet(str);
isolate->object_store()->set_symbol_table(table.Release());
@@ -587,6 +588,7 @@ RawString* Symbols::Lookup(const StringType& str) {
table.Release();
}
if (symbol.IsNull()) {
+ SafepointMutexLocker ml(isolate->symbols_mutex());
SymbolTable table(zone, isolate->object_store()->symbol_table());
symbol ^= table.GetOrNull(str);
table.Release();
« runtime/vm/isolate.h ('K') | « runtime/vm/lockers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698