diff options
author | Sam Gross <colesbury@gmail.com> | 2024-05-03 15:09:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-03 15:09:57 (GMT) |
commit | 2dae505e87e3815f087d4b07a71bb2c5cce22304 (patch) | |
tree | 232577513b53b378623dc28c7dae53c846b2bf77 /Misc | |
parent | 24e643d4ef024a3561c927dc07c59c435bb27bcc (diff) | |
download | cpython-2dae505e87e3815f087d4b07a71bb2c5cce22304.zip cpython-2dae505e87e3815f087d4b07a71bb2c5cce22304.tar.gz cpython-2dae505e87e3815f087d4b07a71bb2c5cce22304.tar.bz2 |
gh-117514: Add `sys._is_gil_enabled()` function (#118514)
The function returns `True` or `False` depending on whether the GIL is
currently enabled. In the default build, it always returns `True`
because the GIL is always enabled.
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2024-05-02-16-04-51.gh-issue-117514.CJiuC0.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-05-02-16-04-51.gh-issue-117514.CJiuC0.rst b/Misc/NEWS.d/next/Core and Builtins/2024-05-02-16-04-51.gh-issue-117514.CJiuC0.rst new file mode 100644 index 0000000..fc162af --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2024-05-02-16-04-51.gh-issue-117514.CJiuC0.rst @@ -0,0 +1,4 @@ +Add ``sys._is_gil_enabled()`` function that returns whether the GIL is +currently enabled. In the default build it always returns ``True`` because +the GIL is always enabled. In the free-threaded build, it may return +``True`` or ``False``. |