Explicitly name all spawned threads
The thread name is shown in debugger as well as panic messages and this patch makes it easier to follow a thread instead of looking through full backtrace, by naming all spawned threads according to their functioning.
This commit is contained in:
@@ -31,7 +31,10 @@ impl loader::Handle for NotifyHandle {
|
||||
fn spawn(sender: loader::Sender) -> NotifyHandle {
|
||||
let actor = NotifyActor::new(sender);
|
||||
let (sender, receiver) = unbounded::<Message>();
|
||||
let thread = jod_thread::spawn(move || actor.run(receiver));
|
||||
let thread = jod_thread::Builder::new()
|
||||
.name("LoaderThread".to_owned())
|
||||
.spawn(move || actor.run(receiver))
|
||||
.expect("failed to spawn thread");
|
||||
NotifyHandle { sender, thread }
|
||||
}
|
||||
fn set_config(&mut self, config: loader::Config) {
|
||||
|
||||
Reference in New Issue
Block a user