Unified executor model

This commit is contained in:
M66B
2022-12-13 10:52:39 +01:00
parent 101371854b
commit 6988d4c552
33 changed files with 147 additions and 297 deletions

View File

@@ -59,7 +59,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
@@ -99,7 +98,6 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
private IBoundaryCallbackMessages intf;
private State state;
private final ExecutorService executor = Helper.getBackgroundExecutor(1, "boundary");
private static final int SEARCH_LIMIT_DEVICE = 1000;
@@ -151,7 +149,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
}
void retry() {
executor.submit(new Runnable() {
Helper.getSerialExecutor().submit(new Runnable() {
@Override
public void run() {
close(state, true);
@@ -168,7 +166,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
state.queued.incrementAndGet();
Log.i("Boundary queued +" + state.queued.get());
executor.submit(new Runnable() {
Helper.getSerialExecutor().submit(new Runnable() {
@Override
public void run() {
Helper.gc();
@@ -895,7 +893,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
this.intf = null;
Log.i("Boundary destroy");
executor.submit(new Runnable() {
Helper.getSerialExecutor().submit(new Runnable() {
@Override
public void run() {
close(state, true);