]> git.proxmox.com Git - rustc.git/blame - library/std/src/sys/unsupported/thread.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / library / std / src / sys / unsupported / thread.rs
CommitLineData
cdc7bbd5 1use super::unsupported;
3dfed10e
XL
2use crate::ffi::CStr;
3use crate::io;
4use crate::time::Duration;
5
cdc7bbd5 6pub struct Thread(!);
3dfed10e
XL
7
8pub const DEFAULT_MIN_STACK_SIZE: usize = 4096;
9
10impl Thread {
11 // unsafe: see thread::Builder::spawn_unchecked for safety requirements
12 pub unsafe fn new(_stack: usize, _p: Box<dyn FnOnce()>) -> io::Result<Thread> {
13 unsupported()
14 }
15
16 pub fn yield_now() {
17 // do nothing
18 }
19
20 pub fn set_name(_name: &CStr) {
21 // nope
22 }
23
24 pub fn sleep(_dur: Duration) {
25 panic!("can't sleep");
26 }
27
28 pub fn join(self) {
cdc7bbd5 29 self.0
3dfed10e
XL
30 }
31}
32
33pub mod guard {
34 pub type Guard = !;
35 pub unsafe fn current() -> Option<Guard> {
36 None
37 }
38 pub unsafe fn init() -> Option<Guard> {
39 None
40 }
41}