RejctedExecutionException的原因是什么?
除了在Executor之前调用的shutdown()
(我使用的是单线程执行程序)之外,是否还有其他原因引发了RejectedExecutionException?我有一些崩溃报告如下。它们非常罕见,我无法在我的设备上重现。我的代码太复杂,无法发布,但我没有看到调用shutdown()
之后在逻辑上可能会提交任何任务。RejctedExecutionException的原因是什么?
是否有任何其他原因RejectedExecutionException可能会引发?
java.util.concurrent.RejectedExecutionException:任务 [email protected]从 [email protected] [终止,池大小 = 0,活动线程= 0拒绝,排队任务= 0,完成的任务= 9813]在java.util.concurrent.ThreadPoolExecutor中$ AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:1979) 在 java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:786) 在 java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1307) at java.util.concurrent .AbstractExecutorService.submit(AbstractExecutorService.java:81) 在 java.util.concurrent.Executors $ DelegatedExecutorService.submit(Executors.java:562) 在 com.smp.soundtouchandroid.AACFileAudioSink.write(AACFileAudioSink.java:28 ) 在 com.smp.soundtouchandroid.SoundStreamRunnable.processChunk(SoundStreamRunnable.java:469) 在 com.smp.soundtouchandroid.SoundStreamRunnable.processFile(SoundStreamRunnable.java:406) 在 com.smp.soundtouchandroid.SoundStreamRunnable。运行(SoundStreamRunnable.java:223) at java.lang.Thread.run(Thread.java:856)
参见http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html
你的ThreadPoolExecutor是关机或
的ThreadPoolExecutor具有螺纹的有限数,或工作队列具有有限的容量和满(例如,的LinkedBlockingQueue的有限容量中传递给的ThreadPoolExecutor构造函数)。