mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-128360: Add _Py_AssertHoldsTstate
as assertion for holding a thread state (#128361)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
c6b570e5e3
commit
4d0a6595a0
11 changed files with 48 additions and 32 deletions
|
@ -2909,7 +2909,8 @@ _PyMem_DebugRawRealloc(void *ctx, void *p, size_t nbytes)
|
|||
static inline void
|
||||
_PyMem_DebugCheckGIL(const char *func)
|
||||
{
|
||||
if (!PyGILState_Check()) {
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
if (tstate == NULL) {
|
||||
#ifndef Py_GIL_DISABLED
|
||||
_Py_FatalErrorFunc(func,
|
||||
"Python memory allocator called "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue