airbnb / lottie-android

Render After Effects animations natively on Android and iOS, Web, and React Native
http://airbnb.io/lottie/
Apache License 2.0
34.92k stars 5.4k forks source link

Thread pool size will never go beyond corePoolSize if an unbounded queue is used. #2502

Open sadafebrahimi opened 3 months ago

sadafebrahimi commented 3 months ago

Whenever a ThreadPoolExecutor is constructed with an unbounded workQueue, the pool size will never go beyond corePoolSize. Using maximumPoolSize greater than corePoolSize in such case will not have any impact on the maximum bound of pool size.

Error: lottie/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java:214: error: [ErroneousThreadPoolConstructorChecker] Thread pool size will never go beyond corePoolSize if an unbounded queue is used

  private static final Executor setProgressExecutor = new ThreadPoolExecutor(0, 2, 35, TimeUnit.MILLISECONDS,
      new LinkedBlockingQueue<>(), new LottieThreadFactory());

https://android-review.googlesource.com/c/platform/external/lottie/+/3091788