add support of available_parallelism for target hermit
On RustyHermit, the function `get_processor_count` returns the number of activated processors.
This commit is contained in:
parent
910be1b3e8
commit
5842a3fe08
@ -1,6 +1,5 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use super::unsupported;
|
||||
use crate::ffi::CStr;
|
||||
use crate::io;
|
||||
use crate::mem;
|
||||
@ -99,7 +98,7 @@ impl Thread {
|
||||
}
|
||||
|
||||
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
|
||||
unsupported()
|
||||
unsafe { Ok(NonZeroUsize::new_unchecked(abi::get_processor_count())) }
|
||||
}
|
||||
|
||||
pub mod guard {
|
||||
|
Loading…
x
Reference in New Issue
Block a user