cpython/Misc/NEWS.d/next/Core and Builtins/2024-05-02-16-04-51.gh-issue-117514.CJiuC0.rst
Sam Gross 2dae505e87
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.
2024-05-03 11:09:57 -04:00

4 lines
240 B
ReStructuredText

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``.