summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-14 16:55:22 (GMT)
committerGitHub <noreply@github.com>2019-06-14 16:55:22 (GMT)
commit066e5b1a917ec2134e8997d2cadd815724314252 (patch)
tree963b0b6d7d2ae0c580aa48da0d1423930bf2a32d /Doc
parent212646cae6b7c4ddc8d98c8b9b6d39a5f259e864 (diff)
downloadcpython-066e5b1a917ec2134e8997d2cadd815724314252.zip
cpython-066e5b1a917ec2134e8997d2cadd815724314252.tar.gz
cpython-066e5b1a917ec2134e8997d2cadd815724314252.tar.bz2
bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)
In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running. * Add _thread._is_main_interpreter() * threading.Thread.start() now raises RuntimeError if the thread is a daemon thread and the method is called from a subinterpreter. * The _thread module now uses Argument Clinic for the new function. * Use textwrap.dedent() in test_threading.SubinterpThreadingTests
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/threading.rst8
-rw-r--r--Doc/whatsnew/3.9.rst8
2 files changed, 16 insertions, 0 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 9ffd5cd..f80eb22 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -280,6 +280,8 @@ since it is impossible to detect the termination of alien threads.
base class constructor (``Thread.__init__()``) before doing anything else to
the thread.
+ Daemon threads must not be used in subinterpreters.
+
.. versionchanged:: 3.3
Added the *daemon* argument.
@@ -294,6 +296,12 @@ since it is impossible to detect the termination of alien threads.
This method will raise a :exc:`RuntimeError` if called more than once
on the same thread object.
+ Raise a :exc:`RuntimeError` if the thread is a daemon thread and the
+ method is called from a subinterpreter.
+
+ .. versionchanged:: 3.9
+ In a subinterpreter, spawning a daemon thread now raises an exception.
+
.. method:: run()
Method representing the thread's activity.
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst
index 999519f..ef30743 100644
--- a/Doc/whatsnew/3.9.rst
+++ b/Doc/whatsnew/3.9.rst
@@ -86,6 +86,14 @@ New Modules
Improved Modules
================
+threading
+---------
+
+In a subinterpreter, spawning a daemon thread now raises an exception. Daemon
+threads were never supported in subinterpreters. Previously, the subinterpreter
+finalization crashed with a Pyton fatal error if a daemon thread was still
+running.
+
Optimizations
=============