Skip to content

Commit

Permalink
gh-116738: Make _abc module thread-safe (#117488)
Browse files Browse the repository at this point in the history
A collection of small changes aimed at making the `_abc` module safe to
use in a free-threaded build.
  • Loading branch information
swtaarrs authored Apr 11, 2024
1 parent 1b10efa commit f268e32
Show file tree
Hide file tree
Showing 3 changed files with 205 additions and 115 deletions.
12 changes: 12 additions & 0 deletions Include/internal/pycore_typeobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading

0 comments on commit f268e32

Please sign in to comment.