From 0b9cd8a468d63ebda3d7955faf92296d1abcdac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Sat, 4 Jun 2022 20:48:51 +0300 Subject: [PATCH] Increase worker thread stack and name them --- crates/rust-analyzer/src/task_pool.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/rust-analyzer/src/task_pool.rs b/crates/rust-analyzer/src/task_pool.rs index 8338937390322..aeeb3b7c582b1 100644 --- a/crates/rust-analyzer/src/task_pool.rs +++ b/crates/rust-analyzer/src/task_pool.rs @@ -9,7 +9,13 @@ pub(crate) struct TaskPool { impl TaskPool { pub(crate) fn new(sender: Sender) -> TaskPool { - TaskPool { sender, inner: threadpool::ThreadPool::default() } + const STACK_SIZE: usize = 8 * 1024 * 1024; + + let inner = threadpool::Builder::new() + .thread_name("Worker".into()) + .thread_stack_size(STACK_SIZE) + .build(); + TaskPool { sender, inner } } pub(crate) fn spawn(&mut self, task: F)