cpython/Include
Victor Stinner 517cd82ea7
gh-108987: Fix _thread.start_new_thread() race condition (#109135)
Fix _thread.start_new_thread() race condition. If a thread is created
during Python finalization, the newly spawned thread now exits
immediately instead of trying to access freed memory and lead to a
crash.

thread_run() calls PyEval_AcquireThread() which checks if the thread
must exit. The problem was that tstate was dereferenced earlier in
_PyThreadState_Bind() which leads to a crash most of the time.

Move _PyThreadState_CheckConsistency() from thread_run() to
_PyThreadState_Bind().
2023-09-11 17:27:03 +02:00
..
cpython GH-91079: Rename C_RECURSION_LIMIT to Py_C_RECURSION_LIMIT (#108507) 2023-09-08 09:48:28 +00:00
internal gh-108987: Fix _thread.start_new_thread() race condition (#109135) 2023-09-11 17:27:03 +02:00
Python.h gh-108765: Python.h no longer includes <ctype.h> (#108831) 2023-09-03 18:54:27 +02:00
README.rst
abstract.h
bltinmodule.h
boolobject.h
bytearrayobject.h
bytesobject.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
ceval.h
codecs.h
compile.h
complexobject.h
datetime.h
descrobject.h
dictobject.h gh-106004: PyDict_GetItemRef() should only be in the limited API 3.13 (GH-107229) 2023-07-25 21:48:07 +03:00
dynamic_annotations.h
enumobject.h
errcode.h
exports.h gh-108765: Move export code from pyport.h to exports.h (#108855) 2023-09-04 01:04:05 +02:00
fileobject.h
fileutils.h gh-108765: Move stat() fiddling from pyport.h to fileutils.h (#108854) 2023-09-03 21:32:13 +00:00
floatobject.h
frameobject.h
genericaliasobject.h
import.h
interpreteridobject.h gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-107359) 2023-07-27 15:30:16 -06:00
intrcheck.h gh-106320: Remove private _PyOS_IsMainThread() function (#108605) 2023-08-29 03:20:31 +00:00
iterobject.h gh-106320: Remove _PyAnextAwaitable_Type from the public C API (#108597) 2023-08-29 02:05:11 +00:00
listobject.h
longobject.h gh-108444: Add PyLong_AsInt() public function (#108445) 2023-08-24 23:55:30 +02:00
marshal.h
memoryobject.h
methodobject.h
modsupport.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
moduleobject.h
object.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
objimpl.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
opcode.h gh-105481: opcode.h is no longer generated during the build (#108080) 2023-08-17 17:07:58 +01:00
opcode_ids.h GH-108614: Add `RESUME_CHECK` instruction (GH-108630) 2023-09-07 14:39:03 +01:00
osdefs.h gh-108765: Reformat Include/osdefs.h (#108766) 2023-09-01 14:35:39 +00:00
osmodule.h
patchlevel.h
py_curses.h
pybuffer.h
pycapsule.h gh-108240: Add pycore_capsule.h internal header file (#108596) 2023-08-29 01:20:02 +00:00
pydtrace.d
pydtrace.h
pyerrors.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
pyexpat.h
pyframe.h
pyhash.h
pylifecycle.h
pymacconfig.h gh-108765: Reformat Include/pymacconfig.h (#108764) 2023-09-01 14:57:28 +00:00
pymacro.h gh-107249: Implement Py_UNUSED() for MSVC (#107250) 2023-07-25 19:28:16 +02:00
pymath.h
pymem.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
pyport.h gh-108765: Move export code from pyport.h to exports.h (#108855) 2023-09-04 01:04:05 +02:00
pystate.h
pystats.h gh-108753: Enhance pystats (#108754) 2023-09-06 15:54:59 +00:00
pystrcmp.h
pystrtod.h gh-106320: Remove private float C API functions (#108430) 2023-08-24 19:09:49 +02:00
pythonrun.h
pythread.h
pytypedefs.h
rangeobject.h
setobject.h
sliceobject.h
structmember.h
structseq.h
sysmodule.h
traceback.h
tupleobject.h
typeslots.h
unicodeobject.h gh-108765: Move standard includes to Python.h (#108769) 2023-09-01 21:03:20 +02:00
warnings.h
weakrefobject.h

README.rst

The Python C API
================

The C API is divided into these sections:

1. ``Include/``: Limited API
2. ``Include/cpython/``: CPython implementation details
3. ``Include/cpython/``, names with the ``PyUnstable_`` prefix: API that can
   change between minor releases
4. ``Include/internal/``, and any name with ``_`` prefix: The internal API

Information on changing the C API is available `in the developer guide`_

.. _in the developer guide: https://devguide.python.org/c-api/