gh-126433: Change channel_info.count to int64_t (GH-126447)
Fix compiler warnings on 32-bit Windows: change channel_info.count
type from Py_ssize_t to int64_t in _interpchannelsmodule.c.
(cherry picked from commit 09d7083962)
Co-authored-by: Victor Stinner <vstinner@python.org>
This includes a drive-by cleanup in _queues_init() and _queues_fini().
This change also applies to the _interpchannels module.
(cherry picked from commit 4848b0b92c, AKA gh-125803)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
The fix applies to the _interpchannels module as well.
I've also included a drive-by typo fix for _interpqueues.
(cherry picked from commit 44f841f01a, AKA gh-125802)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
See 6b98b274b6 for an explanation of the problem and solution. Here I've applied the solution to channels.
(cherry picked from commit 8b209fd4f8, AKA gh-121805)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This fixes a mistake in gh-113012 and adds a test that verifies the fix.
(cherry picked from commit 35a67e36aa, AKA gh-121597)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.
PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.
A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).