Unnamed repository; edit this file 'description' to name the repository.
Auto merge of #12466 - lnicola:worker-thread-stack, r=lnicola
Increase worker thread stack and name them CC #11370
bors 2022-06-05
parent 815b434 · parent 0b9cd8a · commit 6d3396a
-rw-r--r--crates/rust-analyzer/src/task_pool.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/task_pool.rs b/crates/rust-analyzer/src/task_pool.rs
index 8338937390..aeeb3b7c58 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<T> {
impl<T> TaskPool<T> {
pub(crate) fn new(sender: Sender<T>) -> TaskPool<T> {
- 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<F>(&mut self, task: F)