Shuwdown executors after executing all tasks.

Bug: 14113276
Change-Id: Ie42ef30ffe5767ca434db4669efad2027b474e74
main
Keisuke Kuroyanagi 2014-04-17 09:28:52 +09:00
parent ba635ad30d
commit b21edc4402
1 changed files with 7 additions and 2 deletions

View File

@ -47,8 +47,13 @@ public class ExecutorUtils {
public static void shutdownAllExecutors() {
synchronized(sExecutorMap) {
for (final PrioritizedSerialExecutor executor : sExecutorMap.values()) {
executor.shutdown();
sExecutorMap.remove(executor);
executor.execute(new Runnable() {
@Override
public void run() {
executor.shutdown();
sExecutorMap.remove(executor);
}
});
}
}
}