mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-03 15:46:34 +02:00
Download executor
This commit is contained in:
@@ -245,12 +245,13 @@ public class Helper {
|
||||
"wsc", "wsf", "wsh"
|
||||
));
|
||||
|
||||
static ExecutorService sSerialExecutor = null;
|
||||
static ExecutorService sParallelExecutor = null;
|
||||
static ExecutorService sSerialTaskExecutor = null;
|
||||
private static ExecutorService sSerialExecutor = null;
|
||||
private static ExecutorService sParallelExecutor = null;
|
||||
private static ExecutorService sSerialTaskExecutor = null;
|
||||
private static ExecutorService sDownloadExecutor = null;
|
||||
|
||||
static int sOperationIndex = 0;
|
||||
static final ExecutorService[] sOperationExecutor = new ExecutorService[OPERATION_WORKERS];
|
||||
private static int sOperationIndex = 0;
|
||||
private static final ExecutorService[] sOperationExecutor = new ExecutorService[OPERATION_WORKERS];
|
||||
|
||||
static ExecutorService getSerialExecutor() {
|
||||
if (sSerialExecutor == null)
|
||||
@@ -270,6 +271,12 @@ public class Helper {
|
||||
return sSerialTaskExecutor;
|
||||
}
|
||||
|
||||
static ExecutorService getDownloadTaskExecutor() {
|
||||
if (sDownloadExecutor == null)
|
||||
sDownloadExecutor = getBackgroundExecutor(0, "download");
|
||||
return sDownloadExecutor;
|
||||
}
|
||||
|
||||
static ExecutorService getOperationExecutor() {
|
||||
synchronized (sOperationExecutor) {
|
||||
if (sOperationExecutor[sOperationIndex] == null)
|
||||
|
||||
Reference in New Issue
Block a user