summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2014-09-25 17:03:12 -0700
committerMathieu Chartier <mathieuc@google.com>2014-09-26 16:04:56 -0700
commit9ef78b59da51080882e47505896b420977fd79ae (patch)
tree6c568756e4e16e68d5d3346261009350969d5b77 /runtime/runtime.h
parent95f03e6a4737f90685fab86e98709f1c4393d5ef (diff)
downloadart-9ef78b59da51080882e47505896b420977fd79ae.tar.gz
art-9ef78b59da51080882e47505896b420977fd79ae.tar.bz2
art-9ef78b59da51080882e47505896b420977fd79ae.zip
Fix broken runtime SetStatsEnabled logic
Previously, Runtime::SetStatsEnabled wouldn't take stats_enabled_ into account when deciding whether or not to increment / decrement teh stats enabled counter. This resulted in counter underflows and other errors which caused some CTS tests to fail. Also added some locking to prevent race conditions. Bug: 17360878 (cherry picked from commit a98ffd745bbecb2e84a492194950c0b94966546b) Change-Id: I21d241a58d35bd6a607aa2305c6da81720bd0886
Diffstat (limited to 'runtime/runtime.h')
-rw-r--r--runtime/runtime.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 84e40adb98..35e3a8896c 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -389,7 +389,8 @@ class Runtime {
void ResetStats(int kinds);
- void SetStatsEnabled(bool new_state, bool suspended);
+ void SetStatsEnabled(bool new_state) LOCKS_EXCLUDED(Locks::instrument_entrypoints_lock_,
+ Locks::mutator_lock_);
enum class NativeBridgeAction { // private
kUnload,