diff options
author | Hiroshi Yamauchi <yamauchi@google.com> | 2015-04-02 10:18:12 -0700 |
---|---|---|
committer | Hiroshi Yamauchi <yamauchi@google.com> | 2015-04-13 15:37:40 -0700 |
commit | a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547 (patch) | |
tree | 77a722cae515f6b3c7ea54f5b0fd2435682ae55b /runtime/gc/task_processor.cc | |
parent | 67592a44cd5600b3c007b9215e3e5296a61118e8 (diff) | |
download | android_art-a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547.tar.gz android_art-a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547.tar.bz2 android_art-a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547.zip |
getRuntimeStat() support (ART).
Export some runtime stats (currently GC stats) via
VMDebug.getRuntimeStat().
Added several new GC stats such as blocking GC counts and GC count
histograms.
Bug: 19825248
Change-Id: I8ece9ed241dc3982dfd983d7159090ba82940dce
Diffstat (limited to 'runtime/gc/task_processor.cc')
-rw-r--r-- | runtime/gc/task_processor.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/runtime/gc/task_processor.cc b/runtime/gc/task_processor.cc index 2ca4b3f922..ef34c68cc4 100644 --- a/runtime/gc/task_processor.cc +++ b/runtime/gc/task_processor.cc @@ -22,7 +22,8 @@ namespace art { namespace gc { TaskProcessor::TaskProcessor() - : lock_(new Mutex("Task processor lock", kReferenceProcessorLock)), is_running_(false) { + : lock_(new Mutex("Task processor lock", kReferenceProcessorLock)), is_running_(false), + running_thread_(nullptr) { // Piggyback off the reference processor lock level. cond_.reset(new ConditionVariable("Task processor condition", *lock_)); } @@ -96,15 +97,22 @@ bool TaskProcessor::IsRunning() const { return is_running_; } +Thread* TaskProcessor::GetRunningThread() const { + MutexLock mu(Thread::Current(), *lock_); + return running_thread_; +} + void TaskProcessor::Stop(Thread* self) { MutexLock mu(self, *lock_); is_running_ = false; + running_thread_ = nullptr; cond_->Broadcast(self); } void TaskProcessor::Start(Thread* self) { MutexLock mu(self, *lock_); is_running_ = true; + running_thread_ = self; } void TaskProcessor::RunAllTasks(Thread* self) { |