From f5c9407a8f6756e4ef9b9ddc6f8e18f6e3fa52ae Mon Sep 17 00:00:00 2001 From: Manas Date: Thu, 8 Jul 2021 18:09:41 +0530 Subject: [PATCH] This patch shortens the spawned threads' names, as threads on Linux have an upper limit of 16 characters for their names. --- crates/flycheck/src/lib.rs | 4 ++-- crates/proc_macro_api/src/process.rs | 2 +- crates/proc_macro_srv/src/proc_macro/bridge/server.rs | 4 ++-- crates/vfs-notify/src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/flycheck/src/lib.rs b/crates/flycheck/src/lib.rs index e55f74bc45..3f98f14592 100644 --- a/crates/flycheck/src/lib.rs +++ b/crates/flycheck/src/lib.rs @@ -68,7 +68,7 @@ impl FlycheckHandle { let actor = FlycheckActor::new(id, sender, config, workspace_root); let (sender, receiver) = unbounded::(); let thread = jod_thread::Builder::new() - .name("FlycheckThread".to_owned()) + .name("Flycheck".to_owned()) .spawn(move || actor.run(receiver)) .expect("failed to spawn thread"); FlycheckHandle { sender, thread } @@ -270,7 +270,7 @@ impl CargoHandle { let (sender, receiver) = unbounded(); let actor = CargoActor::new(child_stdout, sender); let thread = jod_thread::Builder::new() - .name("CargoHandleThread".to_owned()) + .name("CargoHandle".to_owned()) .spawn(move || actor.run()) .expect("failed to spawn thread"); CargoHandle { child, thread, receiver } diff --git a/crates/proc_macro_api/src/process.rs b/crates/proc_macro_api/src/process.rs index 19f854dba1..91d6a3811b 100644 --- a/crates/proc_macro_api/src/process.rs +++ b/crates/proc_macro_api/src/process.rs @@ -38,7 +38,7 @@ impl ProcMacroProcessSrv { let (task_tx, task_rx) = bounded(0); let handle = jod_thread::Builder::new() - .name("ProcMacroClientThread".to_owned()) + .name("ProcMacroClient".to_owned()) .spawn(move || { client_loop(task_rx, process); }) diff --git a/crates/proc_macro_srv/src/proc_macro/bridge/server.rs b/crates/proc_macro_srv/src/proc_macro/bridge/server.rs index 29b340445e..731d302196 100644 --- a/crates/proc_macro_srv/src/proc_macro/bridge/server.rs +++ b/crates/proc_macro_srv/src/proc_macro/bridge/server.rs @@ -182,7 +182,7 @@ impl ExecutionStrategy for CrossThread1 { let (res_tx, res_rx) = channel(); let join_handle = thread::Builder::new() - .name("DispatchThread".to_owned()) + .name("Dispatch".to_owned()) .spawn(move || { let mut dispatch = |b| { req_tx.send(b).unwrap(); @@ -231,7 +231,7 @@ impl ExecutionStrategy for CrossThread2 { let server_thread = thread::current(); let state2 = state.clone(); let join_handle = thread::Builder::new() - .name("ServerThread".to_owned()) + .name("ProcMacroServer".to_owned()) .spawn(move || { let mut dispatch = |b| { *state2.lock().unwrap() = State::Req(b); diff --git a/crates/vfs-notify/src/lib.rs b/crates/vfs-notify/src/lib.rs index ca341ddae9..7815556f5a 100644 --- a/crates/vfs-notify/src/lib.rs +++ b/crates/vfs-notify/src/lib.rs @@ -32,7 +32,7 @@ impl loader::Handle for NotifyHandle { let actor = NotifyActor::new(sender); let (sender, receiver) = unbounded::(); let thread = jod_thread::Builder::new() - .name("LoaderThread".to_owned()) + .name("VfsLoader".to_owned()) .spawn(move || actor.run(receiver)) .expect("failed to spawn thread"); NotifyHandle { sender, thread }