rust/library/std/src/sys
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
..
common Remove redundant all in cfg 2022-11-26 09:31:40 +00:00
hermit hermit: Remove unused exports 2022-11-29 12:25:35 +01:00
itron kmc-solid: Synchronize with the read when sending a joining task ID to a joinee 2022-12-12 14:36:17 +09:00
sgx std: rename Parker::new to Parker::new_in_place, add safe Parker::new constructor for SGX 2022-12-30 15:49:47 +01:00
solid kmc-solid: Address compiler warnings 2022-12-01 13:18:05 +09:00
unix Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se 2022-12-30 21:26:33 -08:00
unsupported Auto merge of #105698 - joboet:unsupported_threads_once, r=thomcc 2022-12-19 16:46:57 +00:00
wasi std: use a more efficient Once on platforms without threads 2022-12-14 13:55:30 +01:00
wasm std: use a more efficient Once on platforms without threads 2022-12-14 13:55:30 +01:00
windows std: rename Parker::new to Parker::new_in_place, add safe Parker::new constructor for SGX 2022-12-30 15:49:47 +01:00
mod.rs Reduce CString allocations in std as much as possible 2022-10-03 11:13:17 -07:00