8000 gh-120198: Stop the world when setting __class__ on free-threaded build by Fidget-Spinner · Pull Request #120672 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120198: Stop the world when setting __class__ on free-threaded build #120672

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 8 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Address reviews
  • Loading branch information
Fidget-Spinner committed Jun 18, 2024
commit b482f87274d8ae10e25f0ea764445b0dad936466
4 changes: 0 additions & 4 deletions Include/object.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,7 @@ _Py_IsOwnedByCurrentThread(PyObject *ob)

// bpo-39573: The Py_SET_TYPE() function must be used to set an object type.
static inline PyTypeObject* Py_TYPE(PyObject *ob) {
#ifdef Py_GIL_DISABLED
return (PyTypeObject *)&ob->ob_type;
#else
return ob->ob_type;
#endif
}
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
8000 Expand Down
2 changes: 1 addition & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6600,7 +6600,7 @@ object_set_class(PyObject *self, PyObject *value, void *closure)

PyTypeObject *oldto = Py_TYPE(self);
#ifdef Py_GIL_DISABLED
PyInterpreterState *interp = PyInterpreterState_Get();
PyInterpreterState *interp = _PyInterpreterState_GET();
// The real Py_TYPE(self) (`oldto`) may have changed from
// underneath us in another thread, so we re-fetch it here.
_PyEval_StopTheWorld(interp);
Expand Down
Loading
0