diff options
Diffstat (limited to 'libs/hwui/thread/TaskManager.cpp')
-rw-r--r-- | libs/hwui/thread/TaskManager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp index c69b2fd56383..f0ed0bbfedc1 100644 --- a/libs/hwui/thread/TaskManager.cpp +++ b/libs/hwui/thread/TaskManager.cpp @@ -109,8 +109,11 @@ bool TaskManager::WorkerThread::addTask(TaskWrapper task) { return false; } - Mutex::Autolock l(mLock); - ssize_t index = mTasks.add(task); + ssize_t index; + { + Mutex::Autolock l(mLock); + index = mTasks.add(task); + } mSignal.signal(); return index >= 0; |