diff options
| author | J. Ryan Stinnett <jryans@gmail.com> | 2020-11-12 03:40:15 +0000 | 
|---|---|---|
| committer | J. Ryan Stinnett <jryans@gmail.com> | 2020-11-12 03:40:15 +0000 | 
| commit | bf3be09ee800de4ec98dfeea5088639e1c538813 (patch) | |
| tree | 5c313045e58dae9a0a993f6cb06b492ba90ef663 /library/std/src/sys/unix/futex.rs | |
| parent | 951576051bafe03cd6ea36707e4ed8b25355fb58 (diff) | |
| download | rust-bf3be09ee800de4ec98dfeea5088639e1c538813.tar.gz rust-bf3be09ee800de4ec98dfeea5088639e1c538813.zip | |
Fix timeout conversion
Diffstat (limited to 'library/std/src/sys/unix/futex.rs')
| -rw-r--r-- | library/std/src/sys/unix/futex.rs | 3 | 
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), ); } } | 
