about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/std/src/sys/unix/futex.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/futex.rs b/library/std/src/sys/unix/futex.rs
index 7ec3794d0b0..42ddc1d514e 100644
--- a/library/std/src/sys/unix/futex.rs
+++ b/library/std/src/sys/unix/futex.rs
@@ -42,14 +42,13 @@ pub fn futex_wait(futex: &AtomicI32, expected: i32, timeout: Option<Duration>) {
         ) -> libc::c_int;
     }
 
-    let timeout_ms = timeout.map(|d| d.as_millis());
     unsafe {
         emscripten_futex_wait(
             futex as *const AtomicI32,
             // `val` is declared unsigned to match the Emscripten headers, but since it's used as
             // an opaque value, we can ignore the meaning of signed vs. unsigned and cast here.
             expected as libc::c_uint,
-            timeout_ms.map_or(crate::f64::INFINITY, |d| d as libc::c_double),
+            timeout.map_or(crate::f64::INFINITY, |d| d.as_secs_f64() * 1000.0),
         );
     }
 }