rust/library/std/src
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
..
backtrace Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00
collections Added const_hash tracking issue id 2022-11-06 18:01:44 +01:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error remove fn backtrace 2022-08-01 20:10:40 +00:00
f32 Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
f64 Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
ffi Guarantee try_reserve preserves the contents on error 2022-08-10 01:51:38 +09:00
fs fs/tests: Fail fast on duplicate errors rather than looping indefinitely 2022-12-14 10:03:46 -05:00
io Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
net Rollup merge of #104182 - gabhijit:ipv6-in6addr-any-doc-fix, r=m-ou-se 2022-12-30 17:01:39 +01:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os enable fuzzy_provenance_casts lint in libstd 2022-11-20 19:23:28 +01:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path make many std tests work in Miri 2022-08-18 18:07:39 -04:00
personality enable fuzzy_provenance_casts lint in libstd 2022-11-20 19:23:28 +01:00
prelude Update bootstrap cfg 2022-12-28 09:18:43 -05:00
process More verbose Debug implementation of std::process:Command 2022-12-27 09:50:01 +01:00
sync Auto merge of #105651 - tgross35:once-cell-inline, r=m-ou-se 2022-12-30 19:22:33 +00:00
sys Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se 2022-12-30 21:26:33 -08:00
sys_common Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se 2022-12-30 21:26:33 -08:00
thread Rollup merge of #105903 - joboet:unify_parking, r=m-ou-se 2022-12-30 21:26:33 -08:00
time Fix non-associativity of Instant math on aarch64-apple-darwin targets 2022-11-13 12:01:42 -08:00
alloc.rs Forbid mixing System with sytem allocator calls 2022-09-03 16:47:12 -05:00
ascii.rs Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
backtrace.rs Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00
env.rs Rollup merge of #101648 - Timmmm:home_dir_docs, r=joshtriplett 2022-12-11 23:36:44 +01:00
error.rs remove cfg(bootstrap) 2022-09-26 10:14:45 +02:00
f32.rs Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
f64.rs Improve accuracy of asinh and acosh 2022-11-17 12:50:33 -08:00
fs.rs Rollup merge of #105100 - jhpratt:fix-docs, r=JohnTitor 2022-12-03 12:51:28 +09:00
keyword_docs.rs review feedback 2022-10-07 15:21:47 +02:00
lib.rs Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
macros.rs stdio: Document no support for writing to non-blocking stdio/stderr 2022-09-07 14:22:57 +01:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Clarify catch_unwind docs about panic hooks 2022-12-28 16:54:42 +01:00
panicking.rs Replace libstd, libcore, liballoc in docs. 2022-12-30 14:00:40 +01:00
path.rs Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
personality.rs Move personality functions to std 2022-08-23 16:12:58 +08:00
primitive_docs.rs disable strict-provenance-violating doctests in Miri 2022-11-22 11:49:02 +01:00
process.rs delete more cfg(bootstrap) 2022-12-28 09:18:43 -05:00
rt.rs Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
time.rs Bump version placeholders to release 2022-11-06 17:11:02 -05:00