【发布时间】:2012-09-22 01:47:04
【问题描述】:
这个问题与List returned from shutdownNow() can not be converted to submitted Runnable相关
问题定义
我想从 Runnable 获得运行时异常,而我只能使用 submit() call which returns me Future<?> 获得。
如果我使用Submit,我会失去execute 提供的功能。因为我将无法再使用shutdownNow() 来跟踪未启动的线程。
这是真的吗
如果我想从我的任务中捕获可运行异常,我将永远无法使用 shutdownnow 来找出未启动的任务。
【问题讨论】:
-
部分原因是我使用
shutdown()代替它没有这个问题。
标签: java executorservice