diff options
Diffstat (limited to 'libs/hwui/thread/TaskManager.cpp')
| -rw-r--r-- | libs/hwui/thread/TaskManager.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp index cb5401c..c69b2fd 100644 --- a/libs/hwui/thread/TaskManager.cpp +++ b/libs/hwui/thread/TaskManager.cpp @@ -14,10 +14,8 @@ * limitations under the License. */ -#include <sys/sysinfo.h> -#if defined(HAVE_PTHREADS) #include <sys/resource.h> -#endif +#include <sys/sysinfo.h> #include "TaskManager.h" #include "Task.h" @@ -83,9 +81,7 @@ bool TaskManager::addTaskBase(const sp<TaskBase>& task, const sp<TaskProcessorBa /////////////////////////////////////////////////////////////////////////////// status_t TaskManager::WorkerThread::readyToRun() { -#if defined(HAVE_PTHREADS) setpriority(PRIO_PROCESS, 0, PRIORITY_FOREGROUND); -#endif return NO_ERROR; } @@ -109,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); @@ -124,10 +122,6 @@ size_t TaskManager::WorkerThread::getTaskCount() const { } void TaskManager::WorkerThread::exit() { - { - Mutex::Autolock l(mLock); - mTasks.clear(); - } requestExit(); mSignal.signal(); } |
