summaryrefslogtreecommitdiff
path: root/libs/hwui/thread/TaskManager.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-02-04 21:53:47 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-04 21:53:48 +0000
commit5ad36d4591e7b3b1b74f0a213d18384f53734ab2 (patch)
treeb65334ee41c519e1a05aa9489b469b0592694728 /libs/hwui/thread/TaskManager.cpp
parentfd2c1307e66573c398ff53eab25ee82735277091 (diff)
parentc3c58e015fa30a0ad87d4af2b95b7071baa8ffe4 (diff)
Merge "Fix ANR caused by hwuiTask thread"
Diffstat (limited to 'libs/hwui/thread/TaskManager.cpp')
-rw-r--r--libs/hwui/thread/TaskManager.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp
index 3c30aab8ad80..c69b2fd56383 100644
--- a/libs/hwui/thread/TaskManager.cpp
+++ b/libs/hwui/thread/TaskManager.cpp
@@ -105,6 +105,8 @@ bool TaskManager::WorkerThread::threadLoop() {
bool TaskManager::WorkerThread::addTask(TaskWrapper task) {
if (!isRunning()) {
run(mName.string(), PRIORITY_DEFAULT);
+ } else if (exitPending()) {
+ return false;
}
Mutex::Autolock l(mLock);
@@ -120,10 +122,6 @@ size_t TaskManager::WorkerThread::getTaskCount() const {
}
void TaskManager::WorkerThread::exit() {
- {
- Mutex::Autolock l(mLock);
- mTasks.clear();
- }
requestExit();
mSignal.signal();
}