Skip to content

Commit c535d5e

Browse files
committed
Applied @kg's changes from #85660.
1 parent 423669e commit c535d5e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/mono/mono/utils/mono-os-mutex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#if !defined(HOST_WIN32)
3838

39-
#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_WASM)
39+
#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_WASI)
4040
#define BROKEN_CLOCK_SOURCE
4141
#endif
4242

src/mono/mono/utils/mono-time.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@ gint64
119119
mono_msec_boottime (void)
120120
{
121121
/* clock_gettime () is found by configure on Apple builds, but its only present from ios 10, macos 10.12, tvos 10 and watchos 3 */
122-
#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)))
122+
#if ((defined(HAVE_CLOCK_MONOTONIC_COARSE) || defined(HAVE_CLOCK_MONOTONIC)) && !(defined(TARGET_IOS) || defined(TARGET_OSX) || defined(TARGET_WATCHOS) || defined(TARGET_TVOS)))
123123
clockid_t clockType =
124-
#if HAVE_CLOCK_MONOTONIC_COARSE
124+
/* emscripten exposes CLOCK_MONOTONIC_COARSE but doesn't implement it */
125+
#if defined(HAVE_CLOCK_MONOTONIC_COARSE) && !defined(TARGET_WASM)
125126
CLOCK_MONOTONIC_COARSE; /* good enough resolution, fastest speed */
126127
#else
127128
CLOCK_MONOTONIC;

0 commit comments

Comments
 (0)