221 |
|
* any special processing that needs to be done once the Executor has |
222 |
|
* fully terminated. |
223 |
|
* |
224 |
< |
* <p>If hook or callback methods throw exceptions, internal worker |
225 |
< |
* threads may in turn fail and abruptly terminate.</dd> |
224 |
> |
* <p>If hook, callback, or BlockingQueue methods throw exceptions, |
225 |
> |
* internal worker threads may in turn fail, abruptly terminate, and |
226 |
> |
* possibly be replaced.</dd> |
227 |
|
* |
228 |
|
* <dt>Queue maintenance</dt> |
229 |
|
* |
1952 |
|
* // ... |
1953 |
|
* protected void afterExecute(Runnable r, Throwable t) { |
1954 |
|
* super.afterExecute(r, t); |
1955 |
< |
* if (t == null && r instanceof Future<?>) { |
1955 |
> |
* if (t == null && r instanceof Future<?> && ((Future<?>)r).isDone()) { |
1956 |
|
* try { |
1957 |
|
* Object result = ((Future<?>) r).get(); |
1958 |
|
* } catch (CancellationException ce) { |