OSDN Git Service

Fix broken runtime SetStatsEnabled logic
authorMathieu Chartier <mathieuc@google.com>
Fri, 26 Sep 2014 00:03:12 +0000 (17:03 -0700)
committerMathieu Chartier <mathieuc@google.com>
Fri, 26 Sep 2014 17:28:20 +0000 (10:28 -0700)
commita98ffd745bbecb2e84a492194950c0b94966546b
tree7470bcbb8fbc01eb80ed74ca585058dc4c81ee8e
parent266b4689731f2c69af0f2854aaab947cf6e89f84
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

Change-Id: I779237d55dda4f35054a4d27fb2c660a38750fc0
runtime/base/mutex.cc
runtime/base/mutex.h
runtime/debugger.cc
runtime/gc/heap.cc
runtime/instrumentation.cc
runtime/instrumentation.h
runtime/native/dalvik_system_VMDebug.cc
runtime/runtime.cc
runtime/runtime.h
runtime/trace.cc