From 02684e8ba413ef7c94514e2ecc3443f8ed8f7bd6 Mon Sep 17 00:00:00 2001 From: SilverFox Date: Thu, 14 Jun 2018 15:39:55 +0800 Subject: [PATCH] Fix that an canceled ScheduledTask can still be executed in rare case --- src/DotNetty.Common/Concurrency/ScheduledTask.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DotNetty.Common/Concurrency/ScheduledTask.cs b/src/DotNetty.Common/Concurrency/ScheduledTask.cs index 380a45a17..b46579ca3 100644 --- a/src/DotNetty.Common/Concurrency/ScheduledTask.cs +++ b/src/DotNetty.Common/Concurrency/ScheduledTask.cs @@ -29,7 +29,7 @@ protected ScheduledTask(AbstractScheduledEventExecutor executor, PreciseTimeSpan public bool Cancel() { - if (!this.AtomicCancellationStateUpdate(CancellationProhibited, CancellationRequested)) + if (!this.AtomicCancellationStateUpdate(CancellationRequested, CancellationProhibited)) { return false; }