diff options
| author | Michael Goulet <michael@errs.io> | 2022-12-30 21:26:33 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-30 21:26:33 -0800 |
| commit | ff3326d9253b1043b327aa5d04f8ef85973e02b1 (patch) | |
| tree | 8422c5f8d3013b2b87a4d0b8c6e143f6547db849 /library/std/src/sys/unix/mod.rs | |
| parent | 5570cda1870a399532c34b36c89fe0b03d59c72c (diff) | |
| parent | 898302e685210baec6c0047108ed192b0d59071f (diff) | |
| download | rust-ff3326d9253b1043b327aa5d04f8ef85973e02b1.tar.gz rust-ff3326d9253b1043b327aa5d04f8ef85973e02b1.zip | |
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.
Diffstat (limited to 'library/std/src/sys/unix/mod.rs')
| -rw-r--r-- | library/std/src/sys/unix/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/std/src/sys/unix/mod.rs b/library/std/src/sys/unix/mod.rs index 9d7a06852b7..30a96be1430 100644 --- a/library/std/src/sys/unix/mod.rs +++ b/library/std/src/sys/unix/mod.rs @@ -40,7 +40,7 @@ pub mod stdio; pub mod thread; pub mod thread_local_dtor; pub mod thread_local_key; -pub mod thread_parker; +pub mod thread_parking; pub mod time; #[cfg(target_os = "espidf")] |
