Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wasi crate for Core API #63676

Merged
merged 23 commits into from
Sep 6, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use non-zero clock id
  • Loading branch information
newpavlov committed Aug 19, 2019
commit 338fc7d042ac868e2c92bfedf2b6850bac1970c9
4 changes: 2 additions & 2 deletions src/libstd/sys/wasi/thread.rs
Original file line number Diff line number Diff line change
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