What are the reasons for the RejctedExecutionException exception?

Are there other reasons for the RejectedExecutionException besides the one thrown shutdown()

earlier in the Executor (I am using a singleThreadExecutor)? I have crash reports as shown below. They are very rare and I cannot reproduce on my devices. My code is too complex to post, but I don't see how logically it is possible that any tasks are dispatched after being called shutdown()

.

Are there any other reasons why a RejectedExecutionException might be thrown here?

java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@4194a5f0 rejected java.util.concurrent.ThreadPoolExecutor@41a36e90[Terminated, pool size = 0, active threads = 0, tasks set = 0, completed tasks = 9813] at java.util.concurrent.ThreadPoolExecutor $ AbortPolicy.rejectedExecution (ThreadPoolExecutor.java:1979) at java.util.concurrent.ThreadPoolExecutor .reject (ThreadPoolExecutor.java:786) at java.util.concurrent.ThreadPoolExecutor.execute (ThreadPoolExecutor.java:1307) at java.util.concurrent.AbstractExecutorService.submit (AbstractExecutorService.java:81) at java.util Executors $ DelegatedExecutorService.submit (Executors.java:562) at com.smp.soundtouchandroid.AACFileAudioSink.write (AACFileAudioSink.java:28) at com.smp.soundtouchandroid.SoundStreamRunnable.processChunk (SoundStreamRunnable.svc) .soundtouchandroid.SoundStreamRunnable.processFile (SoundStreamRunnable.java:406) at com.smp.soundtouchandroid.SoundStreamRunnable.run (SoundStreamRunnable.java:223) to java.lang.Thread.run (Thread.java:856)

+3


source to share


1 answer


See http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html

Your ThreadPoolExecutor exits, or



ThreadPoolExecutor has a finite number of threads, or the work queue has finite capacity and is full (for example, a LinkedBlockingQueue of finite capacity passed to the ThreadPoolExecutor constructor).

+3


source







All Articles