summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorKen Jin <kenjin@python.org>2024-07-10 18:02:08 (GMT)
committerGitHub <noreply@github.com>2024-07-10 18:02:08 (GMT)
commit3bfc9c831ad9a3dcf4457e842f1e612e93014a17 (patch)
tree38211a4b4a67d6b63afc5cd6be363426ee0db86f /Include
parenta802277914405786f6425f2776605c44bd407fc0 (diff)
downloadcpython-3bfc9c831ad9a3dcf4457e842f1e612e93014a17.zip
cpython-3bfc9c831ad9a3dcf4457e842f1e612e93014a17.tar.gz
cpython-3bfc9c831ad9a3dcf4457e842f1e612e93014a17.tar.bz2
gh-120198: Stop the world when setting __class__ on free-threaded build (GH-120672)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_dict.h2
-rw-r--r--Include/object.h8
2 files changed, 2 insertions, 8 deletions
diff --git a/Include/internal/pycore_dict.h b/Include/internal/pycore_dict.h
index 9e0e123..56cc494 100644
--- a/Include/internal/pycore_dict.h
+++ b/Include/internal/pycore_dict.h
@@ -322,6 +322,8 @@ _PyInlineValuesSize(PyTypeObject *tp)
int
_PyDict_DetachFromObject(PyDictObject *dict, PyObject *obj);
+PyDictObject *_PyObject_MaterializeManagedDict_LockHeld(PyObject *);
+
#ifdef __cplusplus
}
#endif
diff --git a/Include/object.h b/Include/object.h
index a1e5b33..abfdb6c 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -249,11 +249,7 @@ PyAPI_FUNC(PyTypeObject*) Py_TYPE(PyObject *ob);
#else
static inline PyTypeObject* _Py_TYPE(PyObject *ob)
{
- #if defined(Py_GIL_DISABLED)
- return (PyTypeObject *)_Py_atomic_load_ptr_relaxed(&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))
@@ -284,11 +280,7 @@ static inline int Py_IS_TYPE(PyObject *ob, PyTypeObject *type) {
static inline void Py_SET_TYPE(PyObject *ob, PyTypeObject *type) {
-#ifdef Py_GIL_DISABLED
- _Py_atomic_store_ptr(&ob->ob_type, type);
-#else
ob->ob_type = type;
-#endif
}
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# define Py_SET_TYPE(ob, type) Py_SET_TYPE(_PyObject_CAST(ob), type)