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

Unified Diff: runtime/vm/compiler_stats.h

Issue 1409173002: More work for background compilation; move pending_functions_ from ObjectStore to Thread. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Better code. Created 5 years, 2 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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler_stats.h
diff --git a/runtime/vm/compiler_stats.h b/runtime/vm/compiler_stats.h
index 4487991224b94bcb84f543dcb677a05726a1cd14..b8894dc17d83519a5f40a87e811a5732f5fff2a6 100644
--- a/runtime/vm/compiler_stats.h
+++ b/runtime/vm/compiler_stats.h
@@ -73,10 +73,11 @@ class CompilerStats {
char* PrintToZone();
};
-// TODO(hausner): make the increment thread-safe.
#define INC_STAT(thread, counter, incr) \
if (FLAG_compiler_stats) { \
- (thread)->isolate()->compiler_stats()->counter += (incr); }
+ MutexLocker ml((thread)->isolate()->mutex()); \
+ (thread)->isolate()->compiler_stats()->counter += (incr); \
+ }
#define STAT_VALUE(thread, counter) \
((FLAG_compiler_stats != false) ? \
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698