10000 gh-111926: Avoid locking in PyType_IsSubtype by mpage · Pull Request #117275 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111926: Avoid locking in PyType_IsSubtype #117275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2341,14 +2341,7 @@ is_subtype_with_mro(PyObject *a_mro, PyTypeObject *a, PyTypeObject *b)
int
PyType_IsSubtype(PyTypeObject *a, PyTypeObject *b)
{
#ifdef Py_GIL_DISABLED
PyObject *mro = _PyType_GetMRO(a);
int res = is_subtype_with_mro(mro, a, b);
Py_XDECREF(mro);
return res;
#else
return is_subtype_with_mro(lookup_tp_mro(a), a, b);
#endif
return is_subtype_with_mro(a->tp_mro, a, b);
}

/* Routines to do a method lookup in the type without looking in the
Expand Down
0