Skip to content

Commit 56ee4fb

Browse files
committed
Update doc comments for spawn hook.
1 parent 706106f commit 56ee4fb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

library/std/src/thread/spawnhook.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ use crate::cell::Cell;
22
use crate::sync::Arc;
33
use crate::thread::Thread;
44

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

@@ -41,7 +45,7 @@ struct SpawnHook {
4145
///
4246
/// Hooks can only be added, not removed.
4347
///
44-
/// The hooks will run in order, starting with the most recently added.
48+
/// The hooks will run in reverse order, starting with the most recently added.
4549
///
4650
/// # Usage
4751
///

0 commit comments

Comments
 (0)