Skip to content

Commit 6cc91cb

Browse files
committed
Rename std::thread::available_onccurrency to std::thread::available_parallelism
1 parent 83f147b commit 6cc91cb

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl Thread {
9797
}
9898
}
9999

100-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
100+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
101101
unsupported()
102102
}
103103

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl Thread {
137137
}
138138
}
139139

140-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
140+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
141141
unsupported()
142142
}
143143

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl Drop for Thread {
263263
}
264264
}
265265

266-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
266+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
267267
cfg_if::cfg_if! {
268268
if #[cfg(any(
269269
target_os = "android",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl Thread {
3131
}
3232
}
3333

34-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
34+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
3535
unsupported()
3636
}
3737

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl Thread {
6464
}
6565
}
6666

67-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
67+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
6868
unsupported()
6969
}
7070

library/std/src/sys/wasm/atomics/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Thread {
4040
pub fn join(self) {}
4141
}
4242

43-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
43+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
4444
unsupported()
4545
}
4646

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl Thread {
100100
}
101101
}
102102

103-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
103+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
104104
let res = unsafe {
105105
let mut sysinfo: c::SYSTEM_INFO = crate::mem::zeroed();
106106
c::GetSystemInfo(&mut sysinfo);

library/std/src/thread/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,12 +1455,12 @@ fn _assert_sync_and_send() {
14551455
///
14561456
/// ```
14571457
/// # #![allow(dead_code)]
1458-
/// #![feature(available_concurrency)]
1458+
/// #![feature(available_parallelism)]
14591459
/// use std::thread;
14601460
///
1461-
/// let count = thread::available_concurrency().map(|n| n.get()).unwrap_or(1);
1461+
/// let count = thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
14621462
/// ```
1463-
#[unstable(feature = "available_concurrency", issue = "74479")]
1464-
pub fn available_concurrency() -> io::Result<NonZeroUsize> {
1465-
imp::available_concurrency()
1463+
#[unstable(feature = "available_parallelism", issue = "74479")]
1464+
pub fn available_parallelism() -> io::Result<NonZeroUsize> {
1465+
imp::available_parallelism()
14661466
}

library/test/src/helpers/concurrency.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ pub fn get_concurrency() -> usize {
99
_ => panic!("RUST_TEST_THREADS is `{}`, should be a positive integer.", value),
1010
}
1111
} else {
12-
thread::available_concurrency().map(|n| n.get()).unwrap_or(1)
12+
thread::available_parallelism().map(|n| n.get()).unwrap_or(1)
1313
}
1414
}

library/test/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#![feature(libc)]
2424
#![feature(rustc_private)]
2525
#![feature(nll)]
26-
#![feature(available_concurrency)]
26+
#![feature(available_parallelism)]
2727
#![feature(bench_black_box)]
2828
#![feature(internal_output_capture)]
2929
#![feature(panic_unwind)]

0 commit comments

Comments
 (0)