Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/7.0-staging] [browser] fix job queue timespan calculation #85784

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private bool SetTimer(uint actualDuration)
// shortest time of all TimerQueues
private static void ReplaceNextSetTimeout(long shortestDueTimeMs, long currentTimeMs)
{
if (shortestDueTimeMs == int.MaxValue)
if (shortestDueTimeMs == long.MaxValue)
{
return;
}
Expand All @@ -85,7 +85,7 @@ private static long ShortestDueTime()
{
if (s_scheduledTimers == null)
{
return int.MaxValue;
return long.MaxValue;
}

long shortestDueTimeMs = long.MaxValue;
Expand All @@ -112,7 +112,7 @@ private static long PumpTimerQueue(long currentTimeMs)
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];
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/utils/mono-os-mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#if !defined(HOST_WIN32)

#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_WASM)
#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_WASI)
#define BROKEN_CLOCK_SOURCE
#endif

Expand Down
5 changes: 3 additions & 2 deletions src/mono/mono/utils/mono-time.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ gint64
mono_msec_boottime (void)
{
/* clock_gettime () is found by configure on Apple builds, but its only present from ios 10, macos 10.12, tvos 10 and watchos 3 */
#if !defined (TARGET_WASM) && ((defined(HAVE_CLOCK_MONOTONIC_COARSE) || defined(HAVE_CLOCK_MONOTONIC)) && !(defined(TARGET_IOS) || defined(TARGET_OSX) || defined(TARGET_WATCHOS) || defined(TARGET_TVOS)))
#if ((defined(HAVE_CLOCK_MONOTONIC_COARSE) || defined(HAVE_CLOCK_MONOTONIC)) && !(defined(TARGET_IOS) || defined(TARGET_OSX) || defined(TARGET_WATCHOS) || defined(TARGET_TVOS)))
clockid_t clockType =
#if HAVE_CLOCK_MONOTONIC_COARSE
/* emscripten exposes CLOCK_MONOTONIC_COARSE but doesn't implement it */
#if defined(HAVE_CLOCK_MONOTONIC_COARSE) && !defined(TARGET_WASM)
CLOCK_MONOTONIC_COARSE; /* good enough resolution, fastest speed */
#else
CLOCK_MONOTONIC;
Expand Down