diff options
Diffstat (limited to 'library')
| -rw-r--r-- | library/std/src/sys/hermit/thread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sgx/thread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unix/thread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/unsupported/thread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/wasi/thread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/wasm/atomics/thread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/windows/thread.rs | 2 | ||||
| -rw-r--r-- | library/std/src/thread/mod.rs | 10 | ||||
| -rw-r--r-- | library/test/src/helpers/concurrency.rs | 2 | ||||
| -rw-r--r-- | library/test/src/lib.rs | 2 |
10 files changed, 14 insertions, 14 deletions
diff --git a/library/std/src/sys/hermit/thread.rs b/library/std/src/sys/hermit/thread.rs index 8be25f84999..81b21fbbb16 100644 --- a/library/std/src/sys/hermit/thread.rs +++ b/library/std/src/sys/hermit/thread.rs @@ -97,7 +97,7 @@ impl Thread { } } -pub fn available_concurrency() -> io::Result<NonZeroUsize> { +pub fn available_parallelism() -> io::Result<NonZeroUsize> { unsupported() } diff --git a/library/std/src/sys/sgx/thread.rs b/library/std/src/sys/sgx/thread.rs index cbb8ba96401..d745a619614 100644 --- a/library/std/src/sys/sgx/thread.rs +++ b/library/std/src/sys/sgx/thread.rs @@ -137,7 +137,7 @@ impl Thread { } } -pub fn available_concurrency() -> io::Result<NonZeroUsize> { +pub fn available_parallelism() -> io::Result<NonZeroUsize> { unsupported() } diff --git a/library/std/src/sys/unix/thread.rs b/library/std/src/sys/unix/thread.rs index 133ad3ea420..6fae31fa71e 100644 --- a/library/std/src/sys/unix/thread.rs +++ b/library/std/src/sys/unix/thread.rs @@ -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", diff --git a/library/std/src/sys/unsupported/thread.rs b/library/std/src/sys/unsupported/thread.rs index dc75d4ee672..a8db251de20 100644 --- a/library/std/src/sys/unsupported/thread.rs +++ b/library/std/src/sys/unsupported/thread.rs @@ -31,7 +31,7 @@ impl Thread { } } -pub fn available_concurrency() -> io::Result<NonZeroUsize> { +pub fn available_parallelism() -> io::Result<NonZeroUsize> { unsupported() } diff --git a/library/std/src/sys/wasi/thread.rs b/library/std/src/sys/wasi/thread.rs index 9ec02bbec26..2e4e474c449 100644 --- a/library/std/src/sys/wasi/thread.rs +++ b/library/std/src/sys/wasi/thread.rs @@ -64,7 +64,7 @@ impl Thread { } } -pub fn available_concurrency() -> io::Result<NonZeroUsize> { +pub fn available_parallelism() -> io::Result<NonZeroUsize> { unsupported() } diff --git a/library/std/src/sys/wasm/atomics/thread.rs b/library/std/src/sys/wasm/atomics/thread.rs index a66ab083757..16418a06226 100644 --- a/library/std/src/sys/wasm/atomics/thread.rs +++ b/library/std/src/sys/wasm/atomics/thread.rs @@ -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() } diff --git a/library/std/src/sys/windows/thread.rs b/library/std/src/sys/windows/thread.rs index a5293133b3a..75f70c2076e 100644 --- a/library/std/src/sys/windows/thread.rs +++ b/library/std/src/sys/windows/thread.rs @@ -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); diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index f44df845bf4..b6b48208ac7 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -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() } diff --git a/library/test/src/helpers/concurrency.rs b/library/test/src/helpers/concurrency.rs index c39a9b0ec02..e25f524ec05 100644 --- a/library/test/src/helpers/concurrency.rs +++ b/library/test/src/helpers/concurrency.rs @@ -9,6 +9,6 @@ pub fn get_concurrency() -> usize { _ => panic!("RUST_TEST_THREADS is `{}`, should be a positive integer.", value), } } else { - thread::available_concurrency().map(|n| n.get()).unwrap_or(1) + thread::available_parallelism().map(|n| n.get()).unwrap_or(1) } } diff --git a/library/test/src/lib.rs b/library/test/src/lib.rs index 251f099f28a..6732c6c61c2 100644 --- a/library/test/src/lib.rs +++ b/library/test/src/lib.rs @@ -23,7 +23,7 @@ #![feature(libc)] #![feature(rustc_private)] #![feature(nll)] -#![feature(available_concurrency)] +#![feature(available_parallelism)] #![feature(bench_black_box)] #![feature(internal_output_capture)] #![feature(panic_unwind)] |
