Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lysnikolaou committed Jun 12, 2024
1 parent 4990181 commit f722c5a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/src/userguide/source_files_and_compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,9 @@ Cython code. Here is the list of currently supported directives:
without an active GIL and prevent the GIL from being enabled
when the module is imported. Otherwise the slot is set to
``Py_MOD_GIL_USED`` which will cause the GIL to be automatically
enabled. Default is False.
enabled. Setting this to True does not itself make the module safe
to run without the GIL; it merely confirms that you have checked
the logic and consider it safe to run. Default is False.

``overflowcheck`` (True / False)
If set to True, raise errors on overflowing C integer arithmetic
Expand Down
9 changes: 9 additions & 0 deletions tests/run/freethreading_compatible.srctree
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ setup(ext_modules=ext_modules)

def test():
import sys
import sysconfig
if not sysconfig.get_config_var("Py_GIL_DISABLED"):
return
assert sys._is_gil_enabled()

######## compatible.py ########
Expand All @@ -29,6 +32,9 @@ def test():

def test():
import sys
import sysconfig
if not sysconfig.get_config_var("Py_GIL_DISABLED"):
return
assert not sys._is_gil_enabled()

######## incompatible.py ########
Expand All @@ -37,4 +43,7 @@ def test():

def test():
import sys
import sysconfig
if not sysconfig.get_config_var("Py_GIL_DISABLED"):
return
assert sys._is_gil_enabled()

0 comments on commit f722c5a

Please sign in to comment.