Skip to content

Commit 4c0b944

Browse files
committed
Revert "add more default sleep_until to different pals"
This reverts commit 0285d33.
1 parent 0285d33 commit 4c0b944

File tree

5 files changed

+5
-20
lines changed

5 files changed

+5
-20
lines changed

library/std/src/sys/pal/hermit/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use super::hermit_abi;
44
use crate::ffi::CStr;
55
use crate::mem::ManuallyDrop;
66
use crate::num::NonZero;
7-
use crate::time::{Duration, Instant};
7+
use crate::time::Duration;
88
use crate::{io, ptr};
99

1010
pub type Tid = hermit_abi::Tid;

library/std/src/sys/pal/sgx/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use super::unsupported;
55
use crate::ffi::CStr;
66
use crate::io;
77
use crate::num::NonZero;
8-
use crate::time::{Duration, Instant};
8+
use crate::time::Duration;
99

1010
pub struct Thread(task_queue::JoinHandle);
1111

library/std/src/sys/pal/teeos/thread.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::ffi::CStr;
22
use crate::mem::{self, ManuallyDrop};
33
use crate::num::NonZero;
44
use crate::sys::os;
5-
use crate::time::{Duration, Instant};
5+
use crate::time::Duration;
66
use crate::{cmp, io, ptr};
77

88
pub const DEFAULT_MIN_STACK_SIZE: usize = 8 * 1024;
@@ -109,14 +109,6 @@ impl Thread {
109109
}
110110
}
111111

112-
pub fn sleep_until(deadline: Instant) {
113-
let now = Instant::now();
114-
115-
if let Some(delay) = deadline.checked_duration_since(now) {
116-
Self::sleep(delay);
117-
}
118-
}
119-
120112
/// must join, because no pthread_detach supported
121113
pub fn join(self) {
122114
let id = self.into_id();

library/std/src/sys/pal/uefi/thread.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::ffi::CStr;
33
use crate::io;
44
use crate::num::NonZero;
55
use crate::ptr::NonNull;
6-
use crate::time::{Duration, Instant};
6+
use crate::time::Duration;
77

88
pub struct Thread(!);
99

@@ -39,14 +39,6 @@ impl Thread {
3939
}
4040
}
4141

42-
pub fn sleep_until(deadline: Instant) {
43-
let now = Instant::now();
44-
45-
if let Some(delay) = deadline.checked_duration_since(now) {
46-
sleep(delay);
47-
}
48-
}
49-
5042
pub fn join(self) {
5143
self.0
5244
}

library/std/src/sys/pal/unix/thread.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ impl Thread {
297297
}
298298

299299
#[cfg(not(any(
300+
target_vendor = "apple",
300301
target_os = "freebsd",
301302
target_os = "netbsd",
302303
target_os = "linux",

0 commit comments

Comments
 (0)