Skip to content

Commit

Permalink
(lib/sleep_until) fmt + fix tiny rebase mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdsk committed Aug 3, 2024
1 parent e45e1fd commit 61439b2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
3 changes: 1 addition & 2 deletions library/std/src/sys/pal/wasi/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ impl Thread {
}
}

pub fn available_parallelism() -> io::Result<NonZero<usize>> {
fn sleep_with(nanos: u64, clock_id: wasi::Clockid, flags: u16) {
let clock = wasi::SubscriptionClock { id: clock_id, timeout: nanos, precision: 0, flags };

Expand All @@ -193,6 +192,6 @@ fn sleep_with(nanos: u64, clock_id: wasi::Clockid, flags: u16) {
}
}

pub fn available_parallelism() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZero<usize>> {
unsupported()
}
13 changes: 1 addition & 12 deletions library/std/src/sys/pal/windows/thread.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
use crate::io;
use crate::num::NonZeroUsize;
use crate::os::windows::io::AsRawHandle;
use crate::os::windows::io::HandleOrNull;
use crate::ptr;
use crate::sys::c;
use crate::sys::handle::Handle;
use crate::sys::stack_overflow;
use crate::sys_common::FromInner;
use crate::time::{Duration, Instant};

use core::ffi::c_void;

use super::time::WaitableTimer;
Expand All @@ -19,7 +8,7 @@ use crate::os::windows::io::{AsRawHandle, HandleOrNull};
use crate::sys::handle::Handle;
use crate::sys::{c, stack_overflow};
use crate::sys_common::FromInner;
use crate::time::{Duration, Instant};
use crate::time::Duration;
use crate::{io, ptr};

pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;
Expand Down
2 changes: 1 addition & 1 deletion library/std/tests/thread.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::cell::{Cell, RefCell};
#![feature(thread_sleep_until)]
use std::cell::{Cell, RefCell};
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::{Duration, Instant};
Expand Down

0 comments on commit 61439b2

Please sign in to comment.