mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
gh-116738: Make _abc module thread-safe (#117488)
A collection of small changes aimed at making the `_abc` module safe to use in a free-threaded build.
This commit is contained in:
parent
1b10efad66
commit
f268e328ed
3 changed files with 205 additions and 115 deletions
|
|
@ -152,6 +152,18 @@ PyAPI_FUNC(PyObject*) _PySuper_Lookup(PyTypeObject *su_type, PyObject *su_obj,
|
|||
|
||||
extern PyObject* _PyType_GetFullyQualifiedName(PyTypeObject *type, char sep);
|
||||
|
||||
// Perform the following operation, in a thread-safe way when required by the
|
||||
// build mode.
|
||||
//
|
||||
// self->tp_flags = (self->tp_flags & ~mask) | flags;
|
||||
extern void _PyType_SetFlags(PyTypeObject *self, unsigned long mask,
|
||||
unsigned long flags);
|
||||
|
||||
// Like _PyType_SetFlags(), but apply the operation to self and any of its
|
||||
// subclasses without Py_TPFLAGS_IMMUTABLETYPE set.
|
||||
extern void _PyType_SetFlagsRecursive(PyTypeObject *self, unsigned long mask,
|
||||
unsigned long flags);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue