summaryrefslogtreecommitdiff
path: root/libs/hwui/thread/TaskManager.cpp
diff options
context:
space:
mode:
authorStan Iliev <stani@google.com>2019-02-05 15:31:28 -0500
committerStan Iliev <stani@google.com>2019-02-05 16:26:58 -0500
commit80dbc35555d21f65fcfe4ede5d7b406cc4190a97 (patch)
tree7987c3c94fce4914026bd2b9cbd42674c19b2a21 /libs/hwui/thread/TaskManager.cpp
parent912ca4023c22c53d3526ce89fd6e7e1a90fe8e58 (diff)
Tell JVM to not wait for HWUI worker threads upon shutdown
RenderThread is setup as a daemon thread, which allows JVM to exit without waiting on it. This CL does same setup for HWUI worker threads, which offload work from the RenderThread. This fixes an issue exposed by Vulkan pipeline, which is pushing different loads to the worker threads and causing some java tests to hang on exit. This is not a Vulkan specific issue, because GL also hangs if worker thread is started. Bug: 123374538 Test: Ran DismissDialogsInstrumentation test Change-Id: Ie4ee94737ced975323a0792f57f8426c958e8056
Diffstat (limited to 'libs/hwui/thread/TaskManager.cpp')
-rw-r--r--libs/hwui/thread/TaskManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp
index 26ff6ebad3b4..6493d495716e 100644
--- a/libs/hwui/thread/TaskManager.cpp
+++ b/libs/hwui/thread/TaskManager.cpp
@@ -21,6 +21,7 @@
#include "TaskManager.h"
#include "TaskProcessor.h"
#include "utils/MathUtils.h"
+#include "renderthread/RenderThread.h"
namespace android {
namespace uirenderer {
@@ -84,6 +85,11 @@ bool TaskManager::addTaskBase(const sp<TaskBase>& task, const sp<TaskProcessorBa
status_t TaskManager::WorkerThread::readyToRun() {
setpriority(PRIO_PROCESS, 0, PRIORITY_FOREGROUND);
+ auto onStartHook = renderthread::RenderThread::getOnStartHook();
+ if (onStartHook) {
+ onStartHook();
+ }
+
return NO_ERROR;
}