Back to project page sqldb.
The source code is released under:
MIT License
If you think the Android project sqldb 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 prj.sqldb.threading; /* w ww . ja v a2 s . c o m*/ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; public class SqlDBThreads { private static ScheduledExecutorService _dbWriter = Executors.newSingleThreadScheduledExecutor(); private static ScheduledExecutorService _dbReader = Executors.newSingleThreadScheduledExecutor(); public static ScheduledFuture<?> scheduleOnWriterDBExecutor(Runnable runnable) { ExceptionThrowingFutureTask task = new ExceptionThrowingFutureTask(runnable); return _dbWriter.schedule(task, 0, TimeUnit.MILLISECONDS); } public static ScheduledFuture<?> scheduleOnReaderDBExecutor(Runnable runnable) { ExceptionThrowingFutureTask task = new ExceptionThrowingFutureTask(runnable); return _dbReader.schedule(task, 0, TimeUnit.MILLISECONDS); } }