Skip to content

Commit 48148b1

Browse files
committed
add support of available_parallelism for target hermit
On RustyHermit, the function `get_processor_count` returns the number of activated processors.
1 parent 34d64ab commit 48148b1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/std/src/sys/hermit/thread.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![allow(dead_code)]
22

3-
use super::unsupported;
43
use crate::ffi::CStr;
54
use crate::io;
65
use crate::mem;
@@ -99,7 +98,7 @@ impl Thread {
9998
}
10099

101100
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
102-
unsupported()
101+
unsafe { Ok(NonZeroUsize::new_unchecked(abi::get_processor_count())) }
103102
}
104103

105104
pub mod guard {

0 commit comments

Comments
 (0)