Skip to content

Commit

Permalink
use non-zero clock id
Browse files Browse the repository at this point in the history
  • Loading branch information
newpavlov committed Aug 19, 2019
1 parent 8394dbb commit 338fc7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libstd/sys/wasi/thread.rs
Expand Up @@ -31,7 +31,7 @@ impl Thread {
assert!(nanos <= u64::max_value() as u128);

let clock = wasi::raw::__wasi_subscription_u_clock_t {
identifier: 0,
identifier: 0x0123_45678,
clock_id: wasi::CLOCK_MONOTONIC,
timeout: nanos as u64,
precision: 0,
Expand All @@ -47,7 +47,7 @@ impl Thread {
let n = wasi::poll_oneoff(&in_, &mut out).unwrap();
let wasi::Event { userdata, error, type_, .. } = out[0];
match (n, userdata, error) {
(1, 0, 0) if type_ == wasi::EVENTTYPE_CLOCK => {}
(1, 0x0123_45678, 0) if type_ == wasi::EVENTTYPE_CLOCK => {}
_ => panic!("thread::sleep(): unexpected result of poll_oneof"),
}
}
Expand Down

0 comments on commit 338fc7d

Please sign in to comment.