diff options
| author | Sebastian Dröge <sebastian@centricular.com> | 2017-11-02 11:26:46 +0200 |
|---|---|---|
| committer | Sebastian Dröge <sebastian@centricular.com> | 2017-11-02 18:33:25 +0200 |
| commit | 568700097950cf66b09dfdf3d608d4f51e0f64ef (patch) | |
| tree | 31f2b8871066664558f09b337d510aa665aca107 /src/libstd/thread | |
| parent | 2379faa933923a97158a4939b9fc82dcbd45430f (diff) | |
| download | rust-568700097950cf66b09dfdf3d608d4f51e0f64ef.tar.gz rust-568700097950cf66b09dfdf3d608d4f51e0f64ef.zip | |
Update the std::thread docs and clarify that panics can nowadays be caught
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index 28a33c7ec14..8c60d9c7bf0 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -25,11 +25,15 @@ //! //! Fatal logic errors in Rust cause *thread panic*, during which //! a thread will unwind the stack, running destructors and freeing -//! owned resources. Thread panic is unrecoverable from within -//! the panicking thread (i.e. there is no 'try/catch' in Rust), but -//! the panic may optionally be detected from a different thread. If -//! the main thread panics, the application will exit with a non-zero -//! exit code. +//! owned resources. While not meant as a 'try/catch' mechanism, panics +//! in Rust can nonetheless be caught with +//! ['catch_unwind'](../../std/panic/fn.catch_unwind.html) and recovered +//! from, or alternatively be resumed with +//! ['resume_unwind'](../../std/panic/fn.resume_unwind.html). If the panic +//! is not caught the thread will exit, but the panic may optionally be +//! detected from a different thread with `join`. If the main thread panics +//! without the panic being caught, the application will exit with a +//! non-zero exit code. //! //! When the main thread of a Rust program terminates, the entire program shuts //! down, even if other threads are still running. However, this module provides |
