Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 06c2bad6 authored by Romain Guy's avatar Romain Guy Committed by Android Git Automerger
Browse files

am 96aadf83: Merge "Prevent AsyncTask from creating too many threads Bug #10228005" into klp-dev

* commit '96aadf83':
  Prevent AsyncTask from creating too many threads Bug #10228005
parents 4b643f0e 96aadf83
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -177,8 +177,9 @@ import java.util.concurrent.atomic.AtomicInteger;
public abstract class AsyncTask<Params, Progress, Result> {
    private static final String LOG_TAG = "AsyncTask";

    private static final int CORE_POOL_SIZE = 5;
    private static final int MAXIMUM_POOL_SIZE = 128;
    private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();
    private static final int CORE_POOL_SIZE = CPU_COUNT + 1;
    private static final int MAXIMUM_POOL_SIZE = CPU_COUNT * 2 + 1;
    private static final int KEEP_ALIVE = 1;

    private static final ThreadFactory sThreadFactory = new ThreadFactory() {
@@ -190,7 +191,7 @@ public abstract class AsyncTask<Params, Progress, Result> {
    };

    private static final BlockingQueue<Runnable> sPoolWorkQueue =
            new LinkedBlockingQueue<Runnable>(10);
            new LinkedBlockingQueue<Runnable>(128);

    /**
     * An {@link Executor} that can be used to execute tasks in parallel.