mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Merge 6f3d2da05c into 7099af8f5e
This commit is contained in:
commit
ae657f7178
1 changed files with 4 additions and 2 deletions
|
|
@ -486,8 +486,10 @@ If the :meth:`~Thread.run` method raises an exception,
|
|||
:func:`threading.excepthook` is called to handle it. By default,
|
||||
:func:`threading.excepthook` ignores silently :exc:`SystemExit`.
|
||||
|
||||
A thread can be flagged as a "daemon thread". The significance of this flag is
|
||||
that the entire Python program exits when only daemon threads are left. The
|
||||
A thread can be flagged as a "daemon thread". A thread with this flag is shut
|
||||
down when the main thread and all other non-daemon threads end.
|
||||
This means a Python program runs as long as non-daemon threads (such as the main
|
||||
thread) are running, and exits when only daemon threads are left. The
|
||||
initial value is inherited from the creating thread. The flag can be set
|
||||
through the :attr:`~Thread.daemon` property or the *daemon* constructor
|
||||
argument.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue