mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-19 01:50:32 +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
|
@ -37,9 +37,12 @@ impl ProcMacroProcessSrv {
|
|||
let process = Process::run(process_path, args)?;
|
||||
|
||||
let (task_tx, task_rx) = bounded(0);
|
||||
let handle = jod_thread::spawn(move || {
|
||||
client_loop(task_rx, process);
|
||||
});
|
||||
let handle = jod_thread::Builder::new()
|
||||
.name("ProcMacroClientThread".to_owned())
|
||||
.spawn(move || {
|
||||
client_loop(task_rx, process);
|
||||
})
|
||||
.expect("failed to spawn thread");
|
||||
|
||||
let task_tx = Arc::new(task_tx);
|
||||
let srv = ProcMacroProcessSrv { inner: Arc::downgrade(&task_tx) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue