mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 19:27:30 +03:00
fecfc0e6cc
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.