Skip to content

Commit 689dc26

Browse files
committed
Clarify thread::Builder::stack_size
1 parent fc6f092 commit 689dc26

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/libstd/thread/mod.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ pub use self::local::{LocalKey, LocalKeyState};
235235
pub struct Builder {
236236
// A name for the thread-to-be, for identification in panic messages
237237
name: Option<String>,
238-
// The size of the stack for the spawned thread
238+
// The size of the stack for the spawned thread in bytes
239239
stack_size: Option<usize>,
240240
}
241241

@@ -289,14 +289,17 @@ impl Builder {
289289
self
290290
}
291291

292-
/// Sets the size of the stack for the new thread.
292+
/// Sets the size of the stack (in bytes) for the new thread.
293+
///
294+
/// The actual stack size may be greater than this value if
295+
/// the platform specifies minimal stack size.
293296
///
294297
/// # Examples
295298
///
296299
/// ```
297300
/// use std::thread;
298301
///
299-
/// let builder = thread::Builder::new().stack_size(10);
302+
/// let builder = thread::Builder::new().stack_size(32 * 1024);
300303
/// ```
301304
#[stable(feature = "rust1", since = "1.0.0")]
302305
pub fn stack_size(mut self, size: usize) -> Builder {

0 commit comments

Comments
 (0)