]> git.lizzy.rs Git - rust.git/commit - src/tools/rust-analyzer
Auto merge of #89310 - joshtriplett:available-concurrency-affinity, r=m-ou-se
authorbors <bors@rust-lang.org>
Sun, 7 Nov 2021 11:53:25 +0000 (11:53 +0000)
committerbors <bors@rust-lang.org>
Sun, 7 Nov 2021 11:53:25 +0000 (11:53 +0000)
commitfecfc0e6cc78d74d5898f168cfeee81256ac9ac7
tree77ba1cbacf4e50cbd7afd041f94088f73dc77cb7
parent90a273b785b3bc482b82c4896ba1bdea68745e46
parent7c9611d124cc0bf127a0d83d75617445f70c422a
Auto merge of #89310 - joshtriplett:available-concurrency-affinity, r=m-ou-se

Make `std::thread::available_concurrency` support process-limited number of CPUs

Use `libc::sched_getaffinity` and count the number of CPUs in the returned mask. This handles cases where the process doesn't have access to all CPUs, such as when limited via `taskset` or similar.

This also covers cgroup cpusets.