Back to project page D2D_Fountain_codes_cp.
The source code is released under:
GNU General Public License
If you think the Android project D2D_Fountain_codes_cp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package sonic.xud.assistclass; /*from www . j a v a 2 s . co m*/ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; public class SingletonThreadPool { private static ThreadPoolExecutor threadPool; private SingletonThreadPool() { super(); } public static ThreadPoolExecutor getThreadPool() { if(threadPool == null){ synchronized (SingletonThreadPool.class) { if(threadPool == null){ BlockingQueue<Runnable> bqueue = new ArrayBlockingQueue<Runnable>(20); threadPool = new ThreadPoolExecutor(5, 5, 1000, TimeUnit.MILLISECONDS, bqueue); } } } return threadPool; } }