summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-08 11:10:33 (GMT)
committerGitHub <noreply@github.com>2023-09-08 11:10:33 (GMT)
commitb55cf2c2d82d7567720df113117752841ce74606 (patch)
tree5a68b820cd77c21d9d5db9a4a1cfe49b309eccf0 /Include
parent9dd28d2da941160abf0b5f54b1e7e3a7ef4465fb (diff)
downloadcpython-b55cf2c2d82d7567720df113117752841ce74606.zip
cpython-b55cf2c2d82d7567720df113117752841ce74606.tar.gz
cpython-b55cf2c2d82d7567720df113117752841ce74606.tar.bz2
[3.11] gh-104690: thread_run() checks for tstate dangling pointer (#109056) (#109134)
gh-104690: thread_run() checks for tstate dangling pointer (#109056) thread_run() of _threadmodule.c now calls _PyThreadState_CheckConsistency() to check if tstate is a dangling pointer when Python is built in debug mode. Rename ceval_gil.c is_tstate_valid() to _PyThreadState_CheckConsistency() to reuse it in _threadmodule.c. (cherry picked from commit f63d37877ad166041489a968233b57540f8456e8)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_pystate.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index cb8f115..8696aaf 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -61,6 +61,10 @@ _Py_ThreadCanHandlePendingCalls(void)
}
+#ifndef NDEBUG
+extern int _PyThreadState_CheckConsistency(PyThreadState *tstate);
+#endif
+
/* Variable and macro for in-line access to current thread
and interpreter state */