[Android] Set core threadpool size to 2
Geoffrey Métais
git at videolan.org
Fri Feb 24 17:47:30 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 24 17:43:15 2017 +0100| [a790381d65224eaa5576d4dd4b35f7c43d4b4a7e] | committer: Geoffrey Métais
Set core threadpool size to 2
We keep 2 threads ready for reuse
> https://code.videolan.org/videolan/vlc-android/commit/a790381d65224eaa5576d4dd4b35f7c43d4b4a7e
---
vlc-android/src/org/videolan/vlc/VLCApplication.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/VLCApplication.java b/vlc-android/src/org/videolan/vlc/VLCApplication.java
index aefea66..3b6a577 100644
--- a/vlc-android/src/org/videolan/vlc/VLCApplication.java
+++ b/vlc-android/src/org/videolan/vlc/VLCApplication.java
@@ -67,7 +67,7 @@ public class VLCApplication extends Application {
private static SimpleArrayMap<String, Object> sDataMap = new SimpleArrayMap<>();
/* Up to 2 threads maximum, inactive threads are killed after 2 seconds */
- private ThreadPoolExecutor mThreadPool = new ThreadPoolExecutor(0, AndroidUtil.isJellyBeanMR1OrLater() ? Runtime.getRuntime().availableProcessors() : 2, 2, TimeUnit.SECONDS,
+ private ThreadPoolExecutor mThreadPool = new ThreadPoolExecutor(2, AndroidUtil.isJellyBeanMR1OrLater() ? Runtime.getRuntime().availableProcessors() : 2, 2, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(), THREAD_FACTORY);
public static final ThreadFactory THREAD_FACTORY = new ThreadFactory() {
@Override
@@ -115,7 +115,6 @@ public class VLCApplication extends Application {
getResources().updateConfiguration(config,
getResources().getDisplayMetrics());
}
-
instance = this;
runBackground(new Runnable() {
More information about the Android
mailing list