mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-129668: Fix thread-safety of MemoryError freelist in free threaded build (gh-129704)
The MemoryError freelist was not thread-safe in the free threaded build. Use a mutex to protect accesses to the freelist. Unlike other freelists, the MemoryError freelist is not performance sensitive.
This commit is contained in:
parent
4d56c40440
commit
51b4edb1a4
3 changed files with 42 additions and 27 deletions
|
@ -24,6 +24,9 @@ struct _Py_exc_state {
|
|||
PyObject *errnomap;
|
||||
PyBaseExceptionObject *memerrors_freelist;
|
||||
int memerrors_numfree;
|
||||
#ifdef Py_GIL_DISABLED
|
||||
PyMutex memerrors_lock;
|
||||
#endif
|
||||
// The ExceptionGroup type
|
||||
PyObject *PyExc_ExceptionGroup;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue