Skip to content

Commit 338fc7d

Browse files
committed
use non-zero clock id
1 parent 8394dbb commit 338fc7d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/sys/wasi/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Thread {
3131
assert!(nanos <= u64::max_value() as u128);
3232

3333
let clock = wasi::raw::__wasi_subscription_u_clock_t {
34-
identifier: 0,
34+
identifier: 0x0123_45678,
3535
clock_id: wasi::CLOCK_MONOTONIC,
3636
timeout: nanos as u64,
3737
precision: 0,
@@ -47,7 +47,7 @@ impl Thread {
4747
let n = wasi::poll_oneoff(&in_, &mut out).unwrap();
4848
let wasi::Event { userdata, error, type_, .. } = out[0];
4949
match (n, userdata, error) {
50-
(1, 0, 0) if type_ == wasi::EVENTTYPE_CLOCK => {}
50+
(1, 0x0123_45678, 0) if type_ == wasi::EVENTTYPE_CLOCK => {}
5151
_ => panic!("thread::sleep(): unexpected result of poll_oneof"),
5252
}
5353
}

0 commit comments

Comments
 (0)