Skip to content

Commit be750c5

Browse files
Merge upstream main into PR #157691
2 parents de3886e + 030e913 commit be750c5

78 files changed

Lines changed: 3117 additions & 8763 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Doc/conf.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@
635635
"library/exceptions.rst": "builtins/exceptions.rst",
636636
"library/threadsafety.rst": "builtins/threadsafety.rst",
637637
"library/time-complexity.rst": "builtins/time-complexity.rst",
638+
# Renamed to tkinter.dialogs.rst in GH-151656
639+
"library/dialog.rst": "library/tkinter.dialogs.rst",
638640
}
639641

640642
# Refuse to run the doctest builder under a mismatched Python

‎Doc/data/stable_abi.dat‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Doc/tools/removed-ids.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ reference/expressions.html: generator.close
8383
reference/expressions.html: generator.send
8484
reference/expressions.html: generator.throw
8585

86-
# Renamed to library/tkinter.dialogs.html
87-
library/dialog.html: (page missing)
88-
8986
# Obsolete sections in 'turtle' docs
9087
library/turtle.html: changes-since-python-2-6
9188
library/turtle.html: changes-since-python-3-0

‎Doc/whatsnew/3.16.rst‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,8 @@ C API changes
10841084
New features
10851085
------------
10861086

1087-
* TODO
1087+
* Add :c:func:`Py_HashBuffer` to the limited C API.
1088+
(Contributed by Victor Stinner in :gh:`148233`.)
10881089

10891090
Porting to Python 3.16
10901091
----------------------

‎Include/cpython/pyhash.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,3 @@ _Py_HashPointer(const void *ptr)
5050
}
5151

5252
PyAPI_FUNC(Py_hash_t) PyObject_GenericHash(PyObject *);
53-
54-
PyAPI_FUNC(Py_hash_t) Py_HashBuffer(const void *ptr, Py_ssize_t len);

‎Include/internal/pycore_pystate.h‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,23 @@ extern void _PyThreadState_Detach(PyThreadState *tstate);
150150
// to the "detached" state.
151151
extern void _PyThreadState_Suspend(PyThreadState *tstate);
152152

153+
#ifdef Py_GIL_DISABLED
154+
// Try to atomically transition a *different* thread's state from "detached"
155+
// to "suspended". On success, the target thread cannot attach until
156+
// _PyThreadState_ResumeDetached() is called, and the caller may safely
157+
// perform operations that are normally only permitted for the owning thread
158+
// (such as merging the biased reference counts of objects it owns).
159+
//
160+
// The caller must not run arbitrary Python code, allocate GC objects, or
161+
// stop the world while holding the thread in the suspended state.
162+
// Returns 1 on success, 0 if the thread was not in the "detached" state.
163+
extern int _PyThreadState_TrySuspendDetached(PyThreadState *tstate);
164+
165+
// Undo a successful _PyThreadState_TrySuspendDetached(): switch the thread
166+
// back to "detached" and wake it if it is waiting to attach.
167+
extern void _PyThreadState_ResumeDetached(PyThreadState *tstate);
168+
#endif
169+
153170
// Mark the thread state as "shutting down". This is used during interpreter
154171
// and runtime finalization. The thread may no longer attach to the
155172
// interpreter and will instead block via _PyThreadState_HangThread().

0 commit comments

Comments
 (0)