--- /dev/null
+package com.enqualcomm.support.utils;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+
+final public class ThreadPool {
+
+ private ExecutorService mService;
+
+ private volatile static ThreadPool instance;
+
+ public ThreadPool() {
+ mService = Executors.newCachedThreadPool();
+ }
+
+
+ public static ThreadPool newInstance() {
+ if (instance == null) {
+ synchronized (ThreadPool.class) {
+ if (instance == null) {
+ instance = new ThreadPool();
+ }
+ }
+ }
+ return instance;
+ }
+
+ public Future<?> submitThreadPool(Runnable runnable) {
+ if (runnable == null) {
+ return null;
+ }
+ return mService.submit(runnable);
+ }
+}