diff options
| author | Christiaan Dirkx <christiaan@dirkx.email> | 2021-04-29 11:40:14 +0200 |
|---|---|---|
| committer | Christiaan Dirkx <christiaan@dirkx.email> | 2021-06-21 11:01:46 +0200 |
| commit | 9063edaf3bcf3d0897ee3e73b6468c3984883b18 (patch) | |
| tree | 1b57b0dde3109e46a405a1353473a89a61fce447 /library/std/src/sys/wasi | |
| parent | 3824017f8e57ce9dac6d69a1ce07f41c7034f82d (diff) | |
Move `available_concurrency` implementation to `sys`
Diffstat (limited to 'library/std/src/sys/wasi')
| -rw-r--r-- | library/std/src/sys/wasi/thread.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/std/src/sys/wasi/thread.rs b/library/std/src/sys/wasi/thread.rs index 74515553a82..959077f7b54 100644 --- a/library/std/src/sys/wasi/thread.rs +++ b/library/std/src/sys/wasi/thread.rs @@ -3,6 +3,7 @@ use crate::ffi::CStr; use crate::io; use crate::mem; +use crate::num::NonZeroUsize; use crate::sys::unsupported; use crate::time::Duration; @@ -63,6 +64,13 @@ impl Thread { } } +pub fn available_concurrency() -> io::Result<NonZeroUsize> { + Err(io::Error::new_const( + io::ErrorKind::NotFound, + &"The number of hardware threads is not known for the target platform", + )) +} + pub mod guard { pub type Guard = !; pub unsafe fn current() -> Option<Guard> { |
