Skip to content

Commit 20479b7

Browse files
committed
thread spawn hooks: rename run to make it clear that it also handles inheriting spawn hooks
1 parent 39ec825 commit 20479b7

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

library/std/src/thread/lifecycle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ where
6666
let rust_start = move || {
6767
let f = f.into_inner();
6868
let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| {
69-
crate::sys::backtrace::__rust_begin_short_backtrace(|| hooks.run());
69+
crate::sys::backtrace::__rust_begin_short_backtrace(|| hooks.inherit_and_run());
7070
crate::sys::backtrace::__rust_begin_short_backtrace(f)
7171
}));
7272
// SAFETY: `their_packet` as been built just above and moved by the

library/std/src/thread/spawnhook.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub(super) struct ChildSpawnHooks {
144144

145145
impl ChildSpawnHooks {
146146
// This is run on the newly spawned thread, directly at the start.
147-
pub(super) fn run(self) {
147+
pub(super) fn inherit_and_run(self) {
148148
SPAWN_HOOKS.set(self.hooks);
149149
for run in self.to_run {
150150
run();

0 commit comments

Comments
 (0)