From 2abf0f24af60b8644d5b61eed9666793083546ee Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 23 Jul 2015 10:27:30 -0700 Subject: Fix a race condition that could cause lockup Bug: 22676664 If a task is queued on a worker thread that is busy processing a task AND a trim memory signal comes along prior to the initial task being completed then the tasks that were queued prior to the exit request will never be processed. This is bad, as when those futures are used later on, such as in trying to delete them from the cache, they will block waiting for the orphaned task to be finished. Simple fix is to just never stop the worker threads. Increase RAM usage slightly as we won't reclaim that stack space, but this cost is fairly small Change-Id: I818b011f9bc6ba06942fdad81c27656bd97b42d4 --- libs/hwui/Caches.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'libs') diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp index 1030451..aa73d44 100644 --- a/libs/hwui/Caches.cpp +++ b/libs/hwui/Caches.cpp @@ -248,11 +248,6 @@ void Caches::clearGarbage() { void Caches::flush(FlushMode mode) { FLUSH_LOGD("Flushing caches (mode %d)", mode); - // We must stop tasks before clearing caches - if (mode > kFlushMode_Layers) { - tasks.stop(); - } - switch (mode) { case kFlushMode_Full: textureCache.clear(); -- cgit v1.1