about summary refs log tree commit diff
path: root/library/std/src/thread
diff options
context:
space:
mode:
authorSean Linsley <code@seanlinsley.com>2023-03-16 11:07:42 -0500
committerGitHub <noreply@github.com>2023-03-16 11:07:42 -0500
commit54567efda7c08d04383001456976f0f2e43bbfbd (patch)
tree990b0d828c603f0a5e2ff49e3c0d4b43795836c7 /library/std/src/thread
parent7ac4b82ddd596a218cac8cd6b88a91b54fcdcf13 (diff)
downloadrust-54567efda7c08d04383001456976f0f2e43bbfbd.tar.gz
rust-54567efda7c08d04383001456976f0f2e43bbfbd.zip
Clarify that RUST_MIN_STACK is internally cached
For larger applications it's important that users set `RUST_MIN_STACK`
at the start of their program because `min_stack` caches the value.
Not doing so can lead to their `env::set_var` call surprisingly not having any effect.
Diffstat (limited to 'library/std/src/thread')
-rw-r--r--library/std/src/thread/mod.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs
index b9aaf5f6e15..ff65c00483d 100644
--- a/library/std/src/thread/mod.rs
+++ b/library/std/src/thread/mod.rs
@@ -131,7 +131,8 @@
 //!
 //! * Build the thread with [`Builder`] and pass the desired stack size to [`Builder::stack_size`].
 //! * Set the `RUST_MIN_STACK` environment variable to an integer representing the desired stack
-//!   size (in bytes). Note that setting [`Builder::stack_size`] will override this.
+//!   size (in bytes). Note that setting [`Builder::stack_size`] will override this. Also, note
+//!   that `RUST_MIN_STACK` is cached internally so should be set before any threads are started.
 //!
 //! Note that the stack size of the main thread is *not* determined by Rust.
 //!