Back to project page android-sqlite-server.
The source code is released under:
Apache License
If you think the Android project android-sqlite-server 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 org.devtcg.sqliteserver.impl; // w w w . jav a 2s . co m import android.os.HandlerThread; import org.devtcg.sqliteserver.impl.binder.ThreadAffinityExecutor; import java.util.concurrent.atomic.AtomicInteger; public class ExecutorHelper { private static final AtomicInteger mCount = new AtomicInteger(1); private ExecutorHelper() {} public static <T> ThreadAffinityExecutor<T> createThreadAffinityExecutor() { String threadName = "ThreadAffinityExec-" + mCount.getAndIncrement(); return createThreadAffinityExecutor(threadName); } public static <T> ThreadAffinityExecutor<T> createThreadAffinityExecutor(String threadName) { HandlerThread thread = new HandlerThread(threadName); thread.start(); return new ThreadAffinityExecutor<T>(thread.getLooper()); } }