mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-28 10:47:46 +00:00
fc5777e904
Should resolve issues with platforms that don't support AMR (!). Fixes #4640 Fixes #4652 Fixes #4647 // FREEBIE
20 lines
609 B
Java
20 lines
609 B
Java
package org.thoughtcrime.securesms.util;
|
|
|
|
import java.util.concurrent.Executor;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
public class ThreadUtil {
|
|
|
|
public static ExecutorService newDynamicSingleThreadedExecutor() {
|
|
ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS,
|
|
new LinkedBlockingQueue<Runnable>());
|
|
executor.allowCoreThreadTimeOut(true);
|
|
|
|
return executor;
|
|
}
|
|
|
|
}
|