rust/library/std/src/thread
Jonathan Brouwer faa0d67374
Rollup merge of #149482 - RalfJung:scope-tls-dtors, r=joboet
thread::scope: document how join interacts with TLS destructors

Fixes https://github.com/rust-lang/rust/issues/116237 by documenting the current behavior regarding thread-local destructors as intended. (I'm not stoked about this, but documenting it is better than leaving it unclear.)

This also adds documentation for explicit `join` calls (both for scoped and regular threads), saying that those *will* wait for TLS destructors. That reflects my understanding of the current implementation, which calls `join` on the native thread handle. Are we okay with guaranteeing that? I think we should, so people have at least some chance of implementing "wait for all destructors" manually. This fixes https://github.com/rust-lang/rust/issues/127571.

Cc @rust-lang/libs-api
2026-01-29 17:47:31 +01:00
..
builder.rs crate::io::Resultio::Result in most places 2025-12-29 15:09:48 +01:00
current.rs std: split up the thread module 2025-11-29 15:59:11 +01:00
functions.rs Remove Fuchsia from target OS list in unix.rs for sleep 2026-01-27 14:08:15 -08:00
id.rs ThreadId generation fallback path: avoid spurious yields 2025-11-30 22:52:28 +01:00
join_handle.rs Rollup merge of #149482 - RalfJung:scope-tls-dtors, r=joboet 2026-01-29 17:47:31 +01:00
lifecycle.rs std: update references to FromInner etc. 2025-12-15 14:00:37 +01:00
local.rs Finish transition from semitransparent to semiopaque for rustc_macro_transparency 2026-01-08 19:14:45 +01:00
main_thread.rs std: split up the thread module 2025-11-29 15:59:11 +01:00
mod.rs std: update broken links in thread module 2025-11-29 15:59:11 +01:00
scoped.rs Rollup merge of #149482 - RalfJung:scope-tls-dtors, r=joboet 2026-01-29 17:47:31 +01:00
spawnhook.rs std: split up the thread module 2025-11-29 15:59:11 +01:00
tests.rs std: split up the thread module 2025-11-29 15:59:11 +01:00
thread.rs std: update broken links in thread module 2025-11-29 15:59:11 +01:00