From bf3be09ee800de4ec98dfeea5088639e1c538813 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Thu, 12 Nov 2020 03:40:15 +0000 Subject: [PATCH] Fix timeout conversion --- library/std/src/sys/unix/futex.rs | 3 +-- 1 file changed, 1 insertion(+), 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) { ) -> 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), ); } }