1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Refactored timers example to use scheduling executor.

This commit is contained in:
Pawel Piech 2006-10-19 07:30:24 +00:00
parent bc54ad145e
commit 3173aac06c
2 changed files with 11 additions and 3 deletions

View file

@ -66,12 +66,20 @@ public class DefaultDsfExecutor extends ScheduledThreadPoolExecutor
if (r instanceof Future) {
Future future = (Future)r;
try {
/*
* Try to retrieve the value, which should throw exception in
* case when exception was thrown within the Runnable/Callable.
* Must call isDone(), because scheduled futures would block
* on get.
*/
if (future.isDone()) {
future.get();
}
} catch (InterruptedException e) { // Ignore
} catch (CancellationException e) { // Ignore also
} catch (ExecutionException e) {
if (e.getCause() != null) {
logException(t);
logException(e.getCause());
}
}
}

View file

@ -369,7 +369,7 @@ abstract public class DsfSequence extends DsfRunnable implements Future<Object>
if (fRollbackTaskName != null) {
fProgressMonitor.subTask(fRollbackTaskName);
}
fStatus = new Status(IStatus.CANCEL, DsfPlugin.PLUGIN_ID, "Sequence \"" + fTaskName + "\" cancelled.");
fStatus = new Status(IStatus.CANCEL, DsfPlugin.PLUGIN_ID, -1, "Sequence \"" + fTaskName + "\" cancelled.", null);
if (fDone != null) {
fDone.setStatus(fStatus);
}