diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-02-05 23:41:59 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-02-05 23:41:59 +0000 |
commit | b3cd68bc8230dfa38491ee712f33420a02049071 (patch) | |
tree | 44ca1ebe320d7c8390d5800f0cac35ccc873c0bd /libs/hwui/renderthread/RenderThread.cpp | |
parent | 55593a983fa6b5ee0c85a9c71d4dc66d65b3f8d6 (diff) | |
parent | 80dbc35555d21f65fcfe4ede5d7b406cc4190a97 (diff) |
Merge "Tell JVM to not wait for HWUI worker threads upon shutdown"
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 3b37c83a6acc..1f24f0e64eab 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -56,7 +56,7 @@ static const nsecs_t DISPATCH_FRAME_CALLBACKS_DELAY = milliseconds_to_nanosecond static bool gHasRenderThreadInstance = false; -static void (*gOnStartHook)() = nullptr; +static JVMAttachHook gOnStartHook = nullptr; class DisplayEventReceiverWrapper : public VsyncSource { public: @@ -111,11 +111,15 @@ bool RenderThread::hasInstance() { return gHasRenderThreadInstance; } -void RenderThread::setOnStartHook(void (*onStartHook)()) { +void RenderThread::setOnStartHook(JVMAttachHook onStartHook) { LOG_ALWAYS_FATAL_IF(hasInstance(), "can't set an onStartHook after we've started..."); gOnStartHook = onStartHook; } +JVMAttachHook RenderThread::getOnStartHook() { + return gOnStartHook; +} + RenderThread& RenderThread::getInstance() { // This is a pointer because otherwise __cxa_finalize // will try to delete it like a Good Citizen but that causes us to crash |