about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-08-13 16:23:13 -0400
committerCorey Farwell <coreyf@rwell.org>2017-08-13 16:23:13 -0400
commit10bd80d79b006b1a81a66e1a10e333eaa38b068c (patch)
tree90239dd8c389171d382a7c40ff5daf3a6f41bc03 /src/libstd/thread
parent150713ce9fa2e64ef8385b9f143aa46edd5d8bf4 (diff)
downloadrust-10bd80d79b006b1a81a66e1a10e333eaa38b068c.tar.gz
rust-10bd80d79b006b1a81a66e1a10e333eaa38b068c.zip
Indicate thread names get passed to the OS.
Diffstat (limited to 'src/libstd/thread')
-rw-r--r--src/libstd/thread/mod.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index 2668047b812..13965478aee 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -114,10 +114,14 @@
 //!
 //! ## 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
 //!