summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorBrett Simmers <swtaarrs@users.noreply.github.com>2024-04-11 22:13:25 (GMT)
committerGitHub <noreply@github.com>2024-04-11 22:13:25 (GMT)
commitf268e328ed5d7b2df5bdad39691f6e4789a2fcde (patch)
tree6bfa86ec050523a36fcbe1fbf624e48bcbad4896 /Include/internal
parent1b10efad66e9a0b72aae82de23074eafa49ec4db (diff)
downloadcpython-f268e328ed5d7b2df5bdad39691f6e4789a2fcde.zip
cpython-f268e328ed5d7b2df5bdad39691f6e4789a2fcde.tar.gz
cpython-f268e328ed5d7b2df5bdad39691f6e4789a2fcde.tar.bz2
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.
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_typeobject.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Include/internal/pycore_typeobject.h b/Include/internal/pycore_typeobject.h
index 8a25935..1693119 100644
--- a/Include/internal/pycore_typeobject.h
+++ b/Include/internal/pycore_typeobject.h
@@ -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
}