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/sgx | |
| parent | 3824017f8e57ce9dac6d69a1ce07f41c7034f82d (diff) | |
Move `available_concurrency` implementation to `sys`
Diffstat (limited to 'library/std/src/sys/sgx')
| -rw-r--r-- | library/std/src/sys/sgx/thread.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/std/src/sys/sgx/thread.rs b/library/std/src/sys/sgx/thread.rs index 67e2e8b59d3..b82ae86521a 100644 --- a/library/std/src/sys/sgx/thread.rs +++ b/library/std/src/sys/sgx/thread.rs @@ -1,6 +1,7 @@ #![cfg_attr(test, allow(dead_code))] // why is this necessary? use crate::ffi::CStr; use crate::io; +use crate::num::NonZeroUsize; use crate::time::Duration; use super::abi::usercalls; @@ -135,6 +136,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> { |
