Limit simple task thread to number of processors

pull/147/head
M66B 6 years ago
parent 4d9330e60b
commit 522f13a38c

@ -49,7 +49,8 @@ public abstract class SimpleTask<T> implements LifecycleObserver {
private String name;
private Result stored;
private static ExecutorService executor = Executors.newCachedThreadPool(Helper.backgroundThreadFactory);
private static ExecutorService executor = Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors(), Helper.backgroundThreadFactory);
public void execute(Context context, LifecycleOwner owner, Bundle args, String name) {
run(context, owner, args, name);

Loading…
Cancel
Save