std: Handle OS errors when joining threads

Also add to the documentation that the `join` method can panic.

cc #34971
cc #43539
This commit is contained in:
Alex Crichton 2017-08-26 19:36:46 -07:00
parent 398aaffc94
commit dc7c7ba0c9
4 changed files with 13 additions and 2 deletions

View file

@ -1230,6 +1230,11 @@ impl<T> JoinHandle<T> {
/// [`Err`]: ../../std/result/enum.Result.html#variant.Err
/// [`panic`]: ../../std/macro.panic.html
///
/// # Panics
///
/// This function may panic on some platforms if a thread attempts to join
/// itself or otherwise may create a deadlock with joining threads.
///
/// # Examples
///
/// ```