diff options
| author | bors <bors@rust-lang.org> | 2021-10-06 20:17:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-10-06 20:17:28 +0000 |
| commit | 0eabf25b90396dead0b2a1aaa275af18a1ae6008 (patch) | |
| tree | 7ce2589de14b749b44e1db96f5df0588cc1536ce /library/std/src/thread | |
| parent | d480ceff384f80394e9367b5e9d3596d62f20585 (diff) | |
| parent | f31c805038652fd820c0b10502e97472b83151bb (diff) | |
Auto merge of #89608 - Manishearth:rollup-m7kd76f, r=Manishearth
Rollup of 12 pull requests Successful merges: - #87601 (Add functions to add unsigned and signed integers) - #88523 (Expand documentation for `FpCategory`.) - #89050 (refactor: VecDeques Drain fields to private) - #89245 (refactor: make VecDeque's IterMut fields module-private, not just crate-private) - #89324 (Rename `std::thread::available_conccurrency` to `std::thread::available_parallelism`) - #89329 (print-type-sizes: skip field printing for primitives) - #89501 (Note specific regions involved in 'borrowed data escapes' error) - #89506 (librustdoc: Use correct heading levels.) - #89528 (Fix suggestion to borrow when casting from pointer to reference) - #89531 (library std, libc dependency update) - #89588 (Add a test for generic_const_exprs) - #89591 (fix: alloc-optimisation is only for rust llvm) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/thread')
| -rw-r--r-- | library/std/src/thread/mod.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index 9d659102b03..707a55b6258 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -1453,12 +1453,14 @@ 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() +#[doc(alias = "hardware_concurrency")] // Alias for C++ `std::thread::hardware_concurrency`. +#[doc(alias = "available_concurrency")] // Alias for a name we gave this API on unstable. +#[unstable(feature = "available_parallelism", issue = "74479")] +pub fn available_parallelism() -> io::Result<NonZeroUsize> { + imp::available_parallelism() } |
