cpython/Doc/c-api
Gregory P. Smith 9face218e7
Some checks are pending
Tests / Windows MSI (push) Blocked by required conditions
Tests / Hypothesis tests on Ubuntu (push) Blocked by required conditions
Tests / (push) Blocked by required conditions
Tests / Change detection (push) Waiting to run
Tests / Docs (push) Blocked by required conditions
Tests / Check if the ABI has changed (push) Blocked by required conditions
Tests / Check if Autoconf files are up to date (push) Blocked by required conditions
Tests / Check if generated files are up to date (push) Blocked by required conditions
Tests / Android (x86_64) (push) Blocked by required conditions
Tests / Ubuntu SSL tests with OpenSSL (push) Blocked by required conditions
Tests / Android (aarch64) (push) Blocked by required conditions
Tests / WASI (push) Blocked by required conditions
Tests / Address sanitizer (push) Blocked by required conditions
Tests / Sanitizers (push) Blocked by required conditions
Tests / CIFuzz (push) Blocked by required conditions
Tests / All required checks pass (push) Blocked by required conditions
Lint / lint (push) Waiting to run
[3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) (GH-137827)
* [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805)

Instead of surprise crashes and memory corruption, we now hang threads that attempt to re-enter the Python interpreter after Python runtime finalization has started. These are typically daemon threads (our long standing mis-feature) but could also be threads spawned by extension modules that then try to call into Python. This marks the `PyThread_exit_thread` public C API as deprecated as there is no plausible safe way to accomplish that on any supported platform in the face of things like C++ code with finalizers anywhere on a thread's stack. Doing this was the least bad option.

(cherry picked from commit 8cc5aa47ee)

Co-authored-by: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>

* state "3.13.7 and earlier"
* backport: do not add the deprecated marker
* fix Py_IsFinalizing doc ref

---------

Co-authored-by: Jeremy Maitin-Shepard <jeremy@jeremyms.com>
2025-08-17 09:08:14 -07:00
..
abstract.rst
allocation.rst [3.13] gh-134160: Use multi-phase init in documentation examples (GH-134296) (#134754) 2025-05-26 21:50:19 +00:00
apiabiversion.rst
arg.rst [3.13] gh-132909: handle overflow for 'K' format in do_mkvalue (GH-132911) (#132932) 2025-04-25 12:44:53 +00:00
bool.rst
buffer.rst [3.13] gh-132246: Add PEP 688 to C Buffer Protocol docs (GH-132249) (#132282) 2025-05-01 12:09:33 +01:00
bytearray.rst
bytes.rst
call.rst
capsule.rst [3.13] gh-76595: Add note on PyCapsule_Import behavior (GH-134022) (GH-136075) 2025-06-28 13:07:42 +00:00
cell.rst
code.rst [3.13] gh-135755: Document __future__.* and CO_* as proper Sphinx objects (GH-135980) (GH-136371) 2025-08-02 16:19:20 +02:00
codec.rst
complex.rst
concrete.rst
contextvars.rst
conversion.rst
coro.rst
datetime.rst
descriptor.rst
dict.rst [3.13] Fix phrasing in paragraphs with leading "similar" (GH-121135) (#130364) 2025-02-20 15:58:16 +00:00
exceptions.rst [3.13] gh-136209: Add .. c:var:: declarations for C exception types (GH-136210) (GH-136503) 2025-07-10 15:10:51 +02:00
file.rst
float.rst [3.13] gh-136663: fix signatures of PyFloat_Pack/Unpack in docs (GH-136664) (#136667) 2025-07-15 05:37:55 +00:00
frame.rst [3.13] gh-118915: C API: Document frame locals proxies. (GH-127720) (#127831) 2024-12-11 16:34:35 +00:00
function.rst [3.13] gh-135755: Docs: C API: Document missing PyFunction_GET* macros (GH-135762) (GH-135917) 2025-06-25 08:51:58 +00:00
gcsupport.rst [3.13] document Py_VISIT as a macro in the docs (GH-133688) (#134187) 2025-05-18 16:36:04 +00:00
gen.rst
hash.rst [3.13] Fix documentation of hash in PyHash_FuncDef (GH-137595) (#137643) 2025-08-11 11:25:13 +00:00
import.rst
index.rst
init.rst [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) (GH-137827) 2025-08-17 09:08:14 -07:00
init_config.rst [3.13] gh-130940: Remove PyConfig.use_system_logger (#131129) 2025-03-13 11:53:11 +08:00
intro.rst [3.13] gh-133678: Document C API third party tools (GH-134526) (#134792) 2025-05-27 15:44:44 +00:00
iter.rst
iterator.rst
list.rst
long.rst [3.13] Docs: Fix duplicate word typos (GH-135958) (GH-136008) 2025-06-26 20:13:46 -04:00
mapping.rst
marshal.rst
memory.rst [3.13] Doc/c-api/memory.rst: extend --without-pymalloc doc with ASan information (GH-136790) (#136799) 2025-07-20 10:55:40 +02:00
memoryview.rst
method.rst
module.rst [3.13] gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775) (GH-134983) 2025-06-04 14:50:54 +02:00
monitoring.rst Python 3.13.3 2025-04-08 15:54:08 +02:00
none.rst
number.rst
object.rst [3.13] gh-127954: Document PyObject_DelItemString (GH-127986) (#128496) 2025-01-04 20:53:30 +00:00
objimpl.rst
perfmaps.rst
refcounting.rst [3.13] Docs: Fix markups for emphasis (GH-135598) (GH-135686) 2025-06-18 17:44:43 +00:00
reflection.rst
sequence.rst
set.rst
slice.rst [3.13] gh-130214: Document PyEllipsis_Type (GH-130215) (#130223) 2025-02-17 19:23:42 +03:00
stable.rst [3.13] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) (GH-127557) 2024-12-03 13:57:42 +01:00
structures.rst [3.13] gh-130711: Document PyBaseObject_Type (GH-130712) (GH-130792) 2025-03-10 15:05:38 +01:00
sys.rst [3.13] gh-127791: Fix, document, and test PyUnstable_AtExit (GH-127793) (#127819) 2024-12-11 13:40:45 +00:00
time.rst
tuple.rst
type.rst [3.13] Document that PyType_GetModuleByDef returns a borrowed reference (GH-135666) (GH-135702) 2025-06-19 09:18:00 +02:00
typehints.rst
typeobj.rst [3.13] Fix sphinx-lint warnings (default-role used). (GH-134647) (#134669) 2025-05-25 19:29:38 +00:00
unicode.rst Doc: remove unnecessary section header (GH-134917) 2025-05-30 18:14:00 +09:00
utilities.rst
veryhigh.rst [3.13] gh-135755: Document __future__.* and CO_* as proper Sphinx objects (GH-135980) (GH-136371) 2025-08-02 16:19:20 +02:00
weakref.rst