983 |
|
|
984 |
|
|
985 |
|
/** |
986 |
< |
* Tries to remove from the work queue all {@link Cancellable} |
986 |
> |
* Tries to remove from the work queue all {@link Future} |
987 |
|
* tasks that have been cancelled. This method can be useful as a |
988 |
|
* storage reclamation operation, that has no other impact on |
989 |
|
* functionality. Cancelled tasks are never executed, but may |
999 |
|
Iterator<Runnable> it = getQueue().iterator(); |
1000 |
|
while (it.hasNext()) { |
1001 |
|
Runnable r = it.next(); |
1002 |
< |
if (r instanceof Cancellable) { |
1003 |
< |
Cancellable c = (Cancellable)r; |
1002 |
> |
if (r instanceof Future<?>) { |
1003 |
> |
Future<?> c = (Future<?>)r; |
1004 |
|
if (c.isCancelled()) |
1005 |
|
it.remove(); |
1006 |
|
} |