summaryrefslogtreecommitdiffstats
path: root/runtime/thread.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2017-01-17 21:40:35 -0800
committerAndreas Gampe <agampe@google.com>2017-01-18 19:48:37 +0000
commit13093d455b8266338fd713b04261c58e9dc2b164 (patch)
treeb4c5e54ce8a74af2f8929df089133967ea7f7274 /runtime/thread.h
parent3a5e34b65727d2c9e7e6ebe45c337dae0d0398a4 (diff)
downloadart-13093d455b8266338fd713b04261c58e9dc2b164.tar.gz
art-13093d455b8266338fd713b04261c58e9dc2b164.tar.bz2
art-13093d455b8266338fd713b04261c58e9dc2b164.zip
ART: Start RuntimeCallbacks
Add a central RuntimeCallbacks structure to handle certain interesting runtime events. In a first iteration, add ThreadLifecycleCallback with ThreadStart and ThreadStop. Move Dbg over to ThreadLifecycleCallback. Add a test. Bug: 31684920 Test: m test-art-host-gtest-runtime_callbacks_test Test: art/tools/run-jdwp-tests.sh --mode=host Change-Id: Ie0f77739a563207bfb4f04374e72dc6935c40b4f
Diffstat (limited to 'runtime/thread.h')
-rw-r--r--runtime/thread.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/thread.h b/runtime/thread.h
index 2b451bcaee..166ed217d0 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -1704,6 +1704,14 @@ class ScopedTransitioningToRunnable : public ValueObject {
Thread* const self_;
};
+class ThreadLifecycleCallback {
+ public:
+ virtual ~ThreadLifecycleCallback() {}
+
+ virtual void ThreadStart(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) = 0;
+ virtual void ThreadDeath(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_) = 0;
+};
+
std::ostream& operator<<(std::ostream& os, const Thread& thread);
std::ostream& operator<<(std::ostream& os, const StackedShadowFrameType& thread);