Skip to content

Commit 189409f

Browse files
committed
Fix thread documentation
1 parent 522d09d commit 189409f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/libstd/thread.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,15 @@ impl Builder {
342342
}
343343
}
344344

345-
/// Spawn a new, returning a join handle for it.
345+
/// Spawn a new thread, returning a `JoinHandle` for it.
346346
///
347-
/// The child thread may outlive the parent (unless the parent thread
348-
/// is the main thread; the whole process is terminated when the main
349-
/// thread finishes.) The join handle can be used to block on
350-
/// termination of the child thread, including recovering its panics.
347+
/// The join handle will implicitly *detach* the child thread upon being
348+
/// dropped. In this case, the child thread may outlive the parent (unless
349+
/// the parent thread is the main thread; the whole process is terminated when
350+
/// the main thread finishes.) Additionally, the join handle provides a `join`
351+
/// method that can be used to join the child thread. If the child thread
352+
/// panics, `join` will return an `Err` containing the argument given to
353+
/// `panic`.
351354
///
352355
/// # Panics
353356
///

0 commit comments

Comments
 (0)