about summary refs log tree commit diff
path: root/library/std/src/thread/spawnhook.rs
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2024-11-19 18:53:39 +0100
committerMara Bos <m-ou.se@m-ou.se>2024-11-19 18:55:52 +0100
commit691796be03d77951982a86f4913994791ed4fb61 (patch)
treee45a7abf31ed0aec8d77f3da158977ce8447213f /library/std/src/thread/spawnhook.rs
parentb96f023dbd044e70eddd208cd21a295f62e5b28b (diff)
downloadrust-691796be03d77951982a86f4913994791ed4fb61.tar.gz
rust-691796be03d77951982a86f4913994791ed4fb61.zip
Update doc comments for spawn hook.
Diffstat (limited to 'library/std/src/thread/spawnhook.rs')
-rw-r--r--library/std/src/thread/spawnhook.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/library/std/src/thread/spawnhook.rs b/library/std/src/thread/spawnhook.rs
index b979db6bd60..99b5ad9cb9f 100644
--- a/library/std/src/thread/spawnhook.rs
+++ b/library/std/src/thread/spawnhook.rs
@@ -3,8 +3,12 @@ use crate::iter;
 use crate::sync::Arc;
 use crate::thread::Thread;
 
-// A thread local linked list of spawn hooks.
 crate::thread_local! {
+    /// A thread local linked list of spawn hooks.
+    ///
+    /// It is a linked list of Arcs, such that it can very cheaply be inhereted by spawned threads.
+    ///
+    /// (That technically makes it a set of linked lists with shared tails, so a linked tree.)
     static SPAWN_HOOKS: Cell<SpawnHooks> = const { Cell::new(SpawnHooks { first: None }) };
 }
 
@@ -42,7 +46,7 @@ struct SpawnHook {
 ///
 /// Hooks can only be added, not removed.
 ///
-/// The hooks will run in order, starting with the most recently added.
+/// The hooks will run in reverse order, starting with the most recently added.
 ///
 /// # Usage
 ///