rust/library/std/src/thread
bors e55c53c57e Auto merge of #97925 - the8472:cgroupv1, r=joshtriplett
Add cgroupv1 support to available_parallelism

Fixes #97549

My dev machine uses cgroup v2 so I was only able to test that code path. So the v1 code path is written only based on documentation. I could use some help testing that it works on a machine with cgroups v1:

```
$ x.py build --stage 1

# quota.rs
fn main() {
    println!("{:?}", std:🧵:available_parallelism());
}

# assuming stage1 is linked in rustup
$ rust +stage1 quota.rs

# spawn a new cgroup scope for the current user
$ sudo systemd-run -p CPUQuota="300%" --uid=$(id -u) -tdS

# should print Ok(3)
$ ./quota
```

If it doesn't work as expected an strace, the contents of `/proc/self/cgroups` and the structure of `/sys/fs/cgroups` would help.
2022-07-23 13:33:56 +00:00
..
local Squashed implementation of the pass 2021-06-20 16:09:42 +02:00
local.rs Fix some links in the standard library 2022-05-01 00:02:34 +03:00
mod.rs Auto merge of #97925 - the8472:cgroupv1, r=joshtriplett 2022-07-23 13:33:56 +00:00
scoped.rs fix data race in thread::scope 2022-06-27 16:50:42 -04:00
tests.rs Test NLL fix of bad lifetime inference for reference captured in closure. 2022-06-15 11:54:59 +02:00