summaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Include/cpython/weakrefobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/tools/python3/Include/cpython/weakrefobject.h')
-rw-r--r--contrib/tools/python3/Include/cpython/weakrefobject.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/tools/python3/Include/cpython/weakrefobject.h b/contrib/tools/python3/Include/cpython/weakrefobject.h
index fd79fdc2dcc..28acf7265a0 100644
--- a/contrib/tools/python3/Include/cpython/weakrefobject.h
+++ b/contrib/tools/python3/Include/cpython/weakrefobject.h
@@ -30,13 +30,20 @@ struct _PyWeakReference {
PyWeakReference *wr_prev;
PyWeakReference *wr_next;
vectorcallfunc vectorcall;
-};
-PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
+#ifdef Py_GIL_DISABLED
+ /* Pointer to the lock used when clearing in free-threaded builds.
+ * Normally this can be derived from wr_object, but in some cases we need
+ * to lock after wr_object has been set to Py_None.
+ */
+ PyMutex *weakrefs_lock;
+#endif
+};
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
-static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) {
+Py_DEPRECATED(3.13) static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj)
+{
PyWeakReference *ref;
PyObject *obj;
assert(PyWeakref_Check(ref_obj));