Give most spawned threads names (#38302)

Release Notes:

- N/A
This commit is contained in:
Lukas Wirth
2025-09-17 10:11:51 +02:00
committed by GitHub
parent 64d362cbce
commit 531f9ee236
11 changed files with 331 additions and 277 deletions
+7 -3
View File
@@ -6,6 +6,7 @@ use parking_lot::Mutex;
use std::{
path::{Path, PathBuf},
sync::Weak,
thread,
time::Duration,
};
@@ -48,9 +49,12 @@ impl Watcher for MacWatcher {
let (stream, handle) = EventStream::new(&[path], self.latency);
let tx = self.events_tx.clone();
std::thread::spawn(move || {
stream.run(move |events| smol::block_on(tx.send(events)).is_ok());
});
thread::Builder::new()
.name("MacWatcher".to_owned())
.spawn(move || {
stream.run(move |events| smol::block_on(tx.send(events)).is_ok());
})
.unwrap();
handles.insert(path.into(), handle);
Ok(())