Skip to content

Commit 1e67d78

Browse files
committed
Clarify wording on daemon threads
1 parent 71848c9 commit 1e67d78

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/library/threading.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ If the :meth:`~Thread.run` method raises an exception,
274274
:func:`threading.excepthook` is called to handle it. By default,
275275
:func:`threading.excepthook` ignores silently :exc:`SystemExit`.
276276

277-
A thread can be flagged as a "daemon thread". The significance of this flag is
278-
that the entire Python program exits when only daemon threads are left. The
277+
A thread can be flagged as a "daemon thread". A thread with this flag is shut
278+
down when the main thread and all others non-daemon threads end.
279+
This means a Python program runs as long as non-daemon threads (such as the main
280+
thread) are running, and exits when only daemon threads are left. The
279281
initial value is inherited from the creating thread. The flag can be set
280282
through the :attr:`~Thread.daemon` property or the *daemon* constructor
281283
argument.

0 commit comments

Comments
 (0)