]>
Commit | Line | Data |
---|---|---|
cdc7bbd5 | 1 | use super::unsupported; |
3dfed10e XL |
2 | use crate::ffi::CStr; |
3 | use crate::io; | |
4 | use crate::time::Duration; | |
5 | ||
cdc7bbd5 | 6 | pub struct Thread(!); |
3dfed10e XL |
7 | |
8 | pub const DEFAULT_MIN_STACK_SIZE: usize = 4096; | |
9 | ||
10 | impl 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 | ||
33 | pub 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 | } |