fix mistake in timespan calculation (#85677)
authorPavel Savara <pavel.savara@gmail.com>
Wed, 3 May 2023 05:32:39 +0000 (07:32 +0200)
committerGitHub <noreply@github.com>
Wed, 3 May 2023 05:32:39 +0000 (07:32 +0200)
src/mono/System.Private.CoreLib/src/System/Threading/TimerQueue.Browser.Mono.cs

index 580df53de2a8df804e5c344f4ac165981f4ac6a6..ba5e678e8742771380d5b61eafa7c4760d1df7b4 100644 (file)
@@ -65,7 +65,7 @@ namespace System.Threading
         // shortest time of all TimerQueues
         private static void ReplaceNextSetTimeout(long shortestDueTimeMs, long currentTimeMs)
         {
-            if (shortestDueTimeMs == int.MaxValue)
+            if (shortestDueTimeMs == long.MaxValue)
             {
                 return;
             }
@@ -85,7 +85,7 @@ namespace System.Threading
         {
             if (s_scheduledTimers == null)
             {
-                return int.MaxValue;
+                return long.MaxValue;
             }
 
             long shortestDueTimeMs = long.MaxValue;
@@ -112,7 +112,7 @@ namespace System.Threading
             List<TimerQueue> timersToFire = s_scheduledTimersToFire!;
             List<TimerQueue> timers;
             timers = s_scheduledTimers!;
-            long shortestDueTimeMs = int.MaxValue;
+            long shortestDueTimeMs = long.MaxValue;
             for (int i = timers.Count - 1; i >= 0; --i)
             {
                 TimerQueue timer = timers[i];