From 83e7d70bccd93c348d70048e1add3cc1c4ac33c6 Mon Sep 17 00:00:00 2001 From: Mangesh Ghiware Date: Wed, 10 Oct 2012 18:37:24 -0700 Subject: Move calls to LightCycleHelper off the UI thread. Bug: 7320303 Replace multiple methods in LightCycleHelper with a single one that returns relevant metadata. Change-Id: Iaa75b3c1ccc8a5b724b253cec654b5b5acb4878e --- gallerycommon/src/com/android/gallery3d/util/ThreadPool.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gallerycommon/src/com/android') diff --git a/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java b/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java index cada234b3..115dc6625 100644 --- a/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java +++ b/gallerycommon/src/com/android/gallery3d/util/ThreadPool.java @@ -81,8 +81,12 @@ public class ThreadPool { private final Executor mExecutor; public ThreadPool() { + this(CORE_POOL_SIZE, MAX_POOL_SIZE); + } + + public ThreadPool(int initPoolSize, int maxPoolSize) { mExecutor = new ThreadPoolExecutor( - CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME, + initPoolSize, maxPoolSize, KEEP_ALIVE_TIME, TimeUnit.SECONDS, new LinkedBlockingQueue(), new PriorityThreadFactory("thread-pool", android.os.Process.THREAD_PRIORITY_BACKGROUND)); -- cgit v1.2.3