rust/library/std
Michael Goulet ff3326d925
Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se
Unify id-based thread parking implementations

Multiple platforms currently use thread-id-based parking implementations (NetBSD and SGX[^1]). Even though the strategy does not differ, these are duplicated for each platform, as the id is encoded into an atomic thread variable in different ways for each platform.

Since `park` is only called by one thread, it is possible to move the thread id into a separate field. By ensuring that the field is only written to once, before any other threads access it, these accesses can be unsynchronized, removing any restrictions on the size and niches of the thread id.

This PR also renames the internal `thread_parker` modules to `thread_parking`, as that name now better reflects their contents. I hope this does not add too much reviewing noise.

r? `@m-ou-se`

`@rustbot` label +T-libs

[^1]: SOLID supports this as well, I will switch it over in a follow-up PR.
2022-12-30 21:26:33 -08:00
..
benches
primitive_docs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
src Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se 2022-12-30 21:26:33 -08:00
tests Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00
build.rs Library changes for Apple WatchOS 2022-07-20 08:57:36 +01:00
Cargo.toml Bump compiler-builtins to 0.1.85 2022-12-08 15:34:46 +01:00