mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
gh-118362: Fix thread safety around lookups from the type cache in the face of concurrent mutators (#118454)
Add _PyType_LookupRef and use incref before setting attribute on type Makes setting an attribute on a class and signaling type modified atomic Avoid adding re-entrancy exposing the type cache in an inconsistent state by decrefing after type is updated
This commit is contained in:
parent
e6b213ee3f
commit
5a1618a2c8
18 changed files with 439 additions and 126 deletions
|
@ -658,6 +658,7 @@ extern PyObject *_PyType_NewManagedObject(PyTypeObject *type);
|
|||
extern PyTypeObject* _PyType_CalculateMetaclass(PyTypeObject *, PyObject *);
|
||||
extern PyObject* _PyType_GetDocFromInternalDoc(const char *, const char *);
|
||||
extern PyObject* _PyType_GetTextSignatureFromInternalDoc(const char *, const char *, int);
|
||||
extern int _PyObject_SetAttributeErrorContext(PyObject *v, PyObject* name);
|
||||
|
||||
void _PyObject_InitInlineValues(PyObject *obj, PyTypeObject *tp);
|
||||
extern int _PyObject_StoreInstanceAttribute(PyObject *obj,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue