diff options
| author | Josh Triplett <josh@joshtriplett.org> | 2021-09-27 13:05:44 -0700 |
|---|---|---|
| committer | Josh Triplett <josh@joshtriplett.org> | 2021-10-31 01:38:14 +0200 |
| commit | 7c9611d124cc0bf127a0d83d75617445f70c422a (patch) | |
| tree | fe2045524d1cd950f847c79eef475dfd15f9dbf4 /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp | |
| parent | 23be29aacea84b0720de05cd5abeb5ee223de320 (diff) | |
| download | rust-7c9611d124cc0bf127a0d83d75617445f70c422a.tar.gz rust-7c9611d124cc0bf127a0d83d75617445f70c422a.zip | |
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
