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 changed files with 1 additions and 2 deletions
|
@ -1,6 +1,5 @@
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use super::unsupported;
|
|
||||||
use crate::ffi::CStr;
|
use crate::ffi::CStr;
|
||||||
use crate::io;
|
use crate::io;
|
||||||
use crate::mem;
|
use crate::mem;
|
||||||
|
@ -99,7 +98,7 @@ impl Thread {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
|
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
|
||||||
unsupported()
|
unsafe { Ok(NonZeroUsize::new_unchecked(abi::get_processor_count())) }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod guard {
|
pub mod guard {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue