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 15bac4f

Browse files
committedNov 19, 2024
Use Send + Sync for spawn hooks.
1 parent a42af06 commit 15bac4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎std/src/thread/spawnhook.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl Drop for SpawnHooks {
2424
}
2525

2626
struct SpawnHook {
27-
hook: Box<dyn Sync + Fn(&Thread) -> Box<dyn Send + FnOnce()>>,
27+
hook: Box<dyn Send + Sync + Fn(&Thread) -> Box<dyn Send + FnOnce()>>,
2828
next: Option<Arc<SpawnHook>>,
2929
}
3030

@@ -86,7 +86,7 @@ struct SpawnHook {
8686
#[unstable(feature = "thread_spawn_hook", issue = "none")]
8787
pub fn add_spawn_hook<F, G>(hook: F)
8888
where
89-
F: 'static + Sync + Fn(&Thread) -> G,
89+
F: 'static + Send + Sync + Fn(&Thread) -> G,
9090
G: 'static + Send + FnOnce(),
9191
{
9292
SPAWN_HOOKS.with(|h| {

0 commit comments

Comments
 (0)
Failed to load comments.