File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 114114//!
115115//! ## Naming threads
116116//!
117- //! Threads are able to have associated names for identification purposes. For example, the thread
118- //! name is used in panic messages. By default, spawned threads are unnamed. To specify a name for
119- //! a thread, build the thread with [`Builder`] and pass the desired thread name to
120- //! [`Builder::name`]. To retrieve the thread name from within the thread, use [`Thread::name`].
117+ //! Threads are able to have associated names for identification purposes. By default, spawned
118+ //! threads are unnamed. To specify a name for a thread, build the thread with [`Builder`] and pass
119+ //! the desired thread name to [`Builder::name`]. To retrieve the thread name from within the
120+ //! thread, use [`Thread::name`]. A couple examples of where the name of a thread gets used:
121+ //!
122+ //! * If a panic occurs in a named thread, the thread name will be printed in the panic message.
123+ //! * The thread name is provided to the OS where applicable (e.g. `pthread_setname_np` in
124+ //! unix-like platforms).
121125//!
122126//! ## Stack size
123127//!
You can’t perform that action at this time.
0 commit comments