summaryrefslogtreecommitdiffstats
path: root/libs/hwui/thread/TaskManager.cpp
diff options
context:
space:
mode:
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 3c30aab..c69b2fd 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();
}