]> git.lizzy.rs Git - rust.git/commitdiff
Indicate thread names get passed to the OS.
authorCorey Farwell <coreyf@rwell.org>
Sun, 13 Aug 2017 20:23:13 +0000 (16:23 -0400)
committerCorey Farwell <coreyf@rwell.org>
Sun, 13 Aug 2017 20:23:13 +0000 (16:23 -0400)
src/libstd/thread/mod.rs

index 2668047b8121c8e6e9b2d26649c16d623592b8d7..13965478aeea177a87a5deeab3156e33d698742c 100644 (file)
 //!
 //! ## Naming threads
 //!
-//! Threads are able to have associated names for identification purposes. For example, the thread
-//! name is used in panic messages. By default, spawned threads are unnamed. To specify a name for
-//! a thread, build the thread with [`Builder`] and pass the desired thread name to
-//! [`Builder::name`]. To retrieve the thread name from within the thread, use [`Thread::name`].
+//! Threads are able to have associated names for identification purposes. By default, spawned
+//! threads are unnamed. To specify a name for a thread, build the thread with [`Builder`] and pass
+//! the desired thread name to [`Builder::name`]. To retrieve the thread name from within the
+//! thread, use [`Thread::name`]. A couple examples of where the name of a thread gets used:
+//!
+//! * If a panic occurs in a named thread, the thread name will be printed in the panic message.
+//! * The thread name is provided to the OS where applicable (e.g. `pthread_setname_np` in
+//!   unix-like platforms).
 //!
 //! ## Stack size
 //!