From d6ddf04f58336077b64276a50c5298fc3cfb1d52 Mon Sep 17 00:00:00 2001 From: Markus Ewald Date: Tue, 9 Jun 2009 19:47:30 +0000 Subject: [PATCH] On very quickly scheduled recurrent notifications, it was still possible for the wait time to become negative due to the passage of time - now the scheduler will only use the WaitOne() method when the remaining time until notification is positive git-svn-id: file:///srv/devel/repo-conversion/nusu@147 d2e56fa2-650e-0410-a79f-9358c0239efd --- Source/Scheduling/Scheduler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Scheduling/Scheduler.cs b/Source/Scheduling/Scheduler.cs index 7726b5b..ebf38a7 100644 --- a/Source/Scheduling/Scheduler.cs +++ b/Source/Scheduling/Scheduler.cs @@ -419,7 +419,9 @@ namespace Nuclex.Support.Scheduling { this.notificationWaitEvent.WaitOne(); } else { long remainingTicks = nextDueNotification.NextDueTicks - this.timeSource.Ticks; - this.timeSource.WaitOne(this.notificationWaitEvent, remainingTicks); + if(remainingTicks > 0) { + this.timeSource.WaitOne(this.notificationWaitEvent, remainingTicks); + } } // Have we been woken up because the Scheduler is being disposed?