mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
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:
parent
2b6770c936
commit
5e6eee5f63
4 changed files with 61 additions and 43 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue