Rename std:🧵:available_onccurrency to std:🧵:available_parallelism

This commit is contained in:
Yoshua Wuyts 2021-09-28 14:59:33 +02:00
parent 83f147b3ba
commit 6cc91cb3d8
11 changed files with 16 additions and 16 deletions

View file

@ -97,7 +97,7 @@ impl Thread {
}
}
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
unsupported()
}

View file

@ -137,7 +137,7 @@ impl Thread {
}
}
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
unsupported()
}

View file

@ -263,7 +263,7 @@ impl Drop for Thread {
}
}
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
cfg_if::cfg_if! {
if #[cfg(any(
target_os = "android",

View file

@ -31,7 +31,7 @@ impl Thread {
}
}
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
unsupported()
}

View file

@ -64,7 +64,7 @@ impl Thread {
}
}
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
unsupported()
}

View file

@ -40,7 +40,7 @@ impl Thread {
pub fn join(self) {}
}
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
unsupported()
}

View file

@ -100,7 +100,7 @@ impl Thread {
}
}
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
let res = unsafe {
let mut sysinfo: c::SYSTEM_INFO = crate::mem::zeroed();
c::GetSystemInfo(&mut sysinfo);

View file

@ -1455,12 +1455,12 @@ fn _assert_sync_and_send() {
///
/// ```
/// # #![allow(dead_code)]
/// #![feature(available_concurrency)]
/// #![feature(available_parallelism)]
/// use std::thread;
///
/// let count = thread::available_concurrency().map(|n| n.get()).unwrap_or(1);
/// let count = thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
/// ```
#[unstable(feature = "available_concurrency", issue = "74479")]
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
imp::available_concurrency()
#[unstable(feature = "available_parallelism", issue = "74479")]
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
imp::available_parallelism()
}