Make sure cancelled scheduled tasks will not run again if cancelled before

This commit is contained in:
Norman Maurer 2013-03-22 08:12:57 +01:00
parent 28576aa41e
commit 624bda4695

View File

@ -800,6 +800,8 @@ public abstract class SingleThreadEventExecutor extends AbstractEventExecutor {
setSuccessInternal(result); setSuccessInternal(result);
} }
} else { } else {
// check if is done as it may was cancelled
if (!isDone()) {
task.call(); task.call();
if (!executor().isShutdown()) { if (!executor().isShutdown()) {
long p = periodNanos; long p = periodNanos;
@ -813,6 +815,7 @@ public abstract class SingleThreadEventExecutor extends AbstractEventExecutor {
} }
} }
} }
}
} catch (Throwable cause) { } catch (Throwable cause) {
setFailureInternal(cause); setFailureInternal(cause);
} }