]> granicus.if.org Git - python/commit
bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)
authorVictor Stinner <vstinner@redhat.com>
Fri, 14 Jun 2019 16:55:22 +0000 (18:55 +0200)
committerGitHub <noreply@github.com>
Fri, 14 Jun 2019 16:55:22 +0000 (18:55 +0200)
commit066e5b1a917ec2134e8997d2cadd815724314252
tree963b0b6d7d2ae0c580aa48da0d1423930bf2a32d
parent212646cae6b7c4ddc8d98c8b9b6d39a5f259e864
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
Doc/library/threading.rst
Doc/whatsnew/3.9.rst
Lib/_dummy_thread.py
Lib/test/test_threading.py
Lib/threading.py
Misc/NEWS.d/next/Library/2019-06-13-11-59-52.bpo-37266.goLjef.rst [new file with mode: 0644]
Modules/_threadmodule.c
Modules/clinic/_threadmodule.c.h [new file with mode: 0644]