Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2089cb3

Browse files
committedNov 19, 2024
Update doc comments for spawn hook.
1 parent c02090d commit 2089cb3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎std/src/thread/spawnhook.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ use crate::iter;
33
use crate::sync::Arc;
44
use crate::thread::Thread;
55

6-
// A thread local linked list of spawn hooks.
76
crate::thread_local! {
7+
/// A thread local linked list of spawn hooks.
8+
///
9+
/// It is a linked list of Arcs, such that it can very cheaply be inhereted by spawned threads.
10+
///
11+
/// (That technically makes it a set of linked lists with shared tails, so a linked tree.)
812
static SPAWN_HOOKS: Cell<SpawnHooks> = const { Cell::new(SpawnHooks { first: None }) };
913
}
1014

@@ -42,7 +46,7 @@ struct SpawnHook {
4246
///
4347
/// Hooks can only be added, not removed.
4448
///
45-
/// The hooks will run in order, starting with the most recently added.
49+
/// The hooks will run in reverse order, starting with the most recently added.
4650
///
4751
/// # Usage
4852
///

0 commit comments

Comments
 (0)
Failed to load comments.