]> git.lizzy.rs Git - rust.git/commitdiff
Add a link to `thread::Builder` in `thread::spawn`
authorFelix Raimundo <felix.raimundo@tweag.io>
Tue, 9 May 2017 11:27:22 +0000 (13:27 +0200)
committerFelix Raimundo <felix.raimundo@tweag.io>
Tue, 9 May 2017 11:27:22 +0000 (13:27 +0200)
src/libstd/thread/mod.rs

index c1e894510b9125ccbbd9e9bf5684dd55a2ecbf57..19adf3e3c3fd7d35cfb680ac53430c26bcf5a1ff 100644 (file)
@@ -389,6 +389,10 @@ pub fn spawn<F, T>(self, f: F) -> io::Result<JoinHandle<T>> where
 /// panics, [`join`] will return an [`Err`] containing the argument given to
 /// [`panic`].
 ///
+/// This will create a thread using default parameters of [`Builder`], if you
+/// want to specify the stack size or the name of the thread, use this API
+/// instead.
+///
 /// # Panics
 ///
 /// Panics if the OS fails to create a thread; use [`Builder::spawn`]
@@ -454,6 +458,7 @@ pub fn spawn<F, T>(self, f: F) -> io::Result<JoinHandle<T>> where
 /// [`Err`]: ../../std/result/enum.Result.html#variant.Err
 /// [`panic`]: ../../std/macro.panic.html
 /// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn
+/// [`Builder`]: ../../std/thread/struct.Builder.html
 #[stable(feature = "rust1", since = "1.0.0")]
 pub fn spawn<F, T>(f: F) -> JoinHandle<T> where
     F: FnOnce() -> T, F: Send + 'static, T: Send + 'static