Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/stdx/src/thread.rs')
| -rw-r--r-- | crates/stdx/src/thread.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/stdx/src/thread.rs b/crates/stdx/src/thread.rs index 37b7a9f5ed..0000fd1954 100644 --- a/crates/stdx/src/thread.rs +++ b/crates/stdx/src/thread.rs @@ -34,6 +34,8 @@ where Builder::new(intent, name).spawn(f).expect("failed to spawn thread") } +pub const DEFAULT_STACK_SIZE: usize = 16 * 1024 * 1024; + pub struct Builder { intent: ThreadIntent, inner: jod_thread::Builder, @@ -43,7 +45,11 @@ pub struct Builder { impl Builder { #[must_use] pub fn new(intent: ThreadIntent, name: impl Into<String>) -> Self { - Self { intent, inner: jod_thread::Builder::new().name(name.into()), allow_leak: false } + Self { + intent, + inner: jod_thread::Builder::new().name(name.into()).stack_size(DEFAULT_STACK_SIZE), + allow_leak: false, + } } #[must_use] |