diff options
| author | bors <bors@rust-lang.org> | 2021-11-07 11:53:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-07 11:53:25 +0000 |
| commit | fecfc0e6cc78d74d5898f168cfeee81256ac9ac7 (patch) | |
| tree | 77ba1cbacf4e50cbd7afd041f94088f73dc77cb7 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 90a273b785b3bc482b82c4896ba1bdea68745e46 (diff) | |
| parent | 7c9611d124cc0bf127a0d83d75617445f70c422a (diff) | |
| download | rust-fecfc0e6cc78d74d5898f168cfeee81256ac9ac7.tar.gz rust-fecfc0e6cc78d74d5898f168cfeee81256ac9ac7.zip | |
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
