Skip to content

Commit ff2442f

Browse files
authored
Rollup merge of #65617 - newpavlov:patch-2, r=alexcrichton
Fix WASI sleep impl Closes #65607 @sunfishcode Is it fine to use 0 for the `identifier` field? What is this field used for?
2 parents 6f6f3e8 + 1e2b711 commit ff2442f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libstd/sys/wasi/thread.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ impl Thread {
3131
let nanos = dur.as_nanos();
3232
assert!(nanos <= u64::max_value() as u128);
3333

34-
const CLOCK_ID: wasi::Userdata = 0x0123_45678;
34+
const USERDATA: wasi::Userdata = 0x0123_45678;
3535

3636
let clock = wasi::raw::__wasi_subscription_u_clock_t {
37-
identifier: CLOCK_ID,
37+
identifier: 0,
3838
clock_id: wasi::CLOCK_MONOTONIC,
3939
timeout: nanos as u64,
4040
precision: 0,
4141
flags: 0,
4242
};
4343

4444
let in_ = [wasi::Subscription {
45-
userdata: 0,
45+
userdata: USERDATA,
4646
type_: wasi::EVENTTYPE_CLOCK,
4747
u: wasi::raw::__wasi_subscription_u { clock: clock },
4848
}];
@@ -53,7 +53,7 @@ impl Thread {
5353
};
5454
match (res, event) {
5555
(Ok(1), wasi::Event {
56-
userdata: CLOCK_ID,
56+
userdata: USERDATA,
5757
error: 0,
5858
type_: wasi::EVENTTYPE_CLOCK,
5959
..

0 commit comments

Comments
 (0)