| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e233cb4 commit 292ac4f
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,8 @@ always available. | |||
| 22 | 22 | ||
| 23 | 23 | .. versionadded:: 3.2 | |
| 24 | 24 | ||
| 25 | + .. availability:: Unix. | ||
| 26 | + | ||
| 25 | 27 | ||
| 26 | 28 | .. function:: addaudithook(hook) | |
| 27 | 29 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1210,6 +1210,13 @@ def test_pystats(self): | |||
| 1210 | 1210 | sys._stats_clear() | |
| 1211 | 1211 | sys._stats_dump() | |
| 1212 | 1212 | ||
| 1213 | + @test.support.cpython_only | ||
| 1214 | + @unittest.skipUnless(hasattr(sys, 'abiflags'), 'need sys.abiflags') | ||
| 1215 | + def test_disable_gil_abi(self): | ||
| 1216 | + abi_threaded = 't' in sys.abiflags | ||
| 1217 | + py_nogil = (sysconfig.get_config_var('Py_NOGIL') == 1) | ||
| 1218 | + self.assertEqual(py_nogil, abi_threaded) | ||
| 1219 | + | ||
| 1213 | 1220 | ||
| 1214 | 1221 | @test.support.cpython_only | |
| 1215 | 1222 | class UnraisableHookTest(unittest.TestCase): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + The experimental ``--disable-gil`` configure flag now includes "t" (for "threaded") in | ||
| 2 | + extension ABI tags. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,10 +15,16 @@ | |||
| 15 | 15 | #define PYD_DEBUG_SUFFIX "" | |
| 16 | 16 | #endif | |
| 17 | 17 | ||
| 18 | + #ifdef Py_NOGIL | ||
| 19 | + # define PYD_THREADING_TAG "t" | ||
| 20 | + #else | ||
| 21 | + # define PYD_THREADING_TAG "" | ||
| 22 | + #endif | ||
| 23 | + | ||
| 18 | 24 | #ifdef PYD_PLATFORM_TAG | |
| 19 | - #define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) "-" PYD_PLATFORM_TAG ".pyd" | ||
| 25 | + #define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) PYD_THREADING_TAG "-" PYD_PLATFORM_TAG ".pyd" | ||
| 20 | 26 | #else | |
| 21 | - #define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) ".pyd" | ||
| 27 | + #define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) PYD_THREADING_TAG ".pyd" | ||
| 22 | 28 | #endif | |
| 23 | 29 | ||
| 24 | 30 | #define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1489,6 +1489,23 @@ fi | |||
| 1489 | 1489 | AC_SUBST([ABIFLAGS]) | |
| 1490 | 1490 | ABIFLAGS="" | |
| 1491 | 1491 | ||
| 1492 | + # Check for --disable-gil | ||
| 1493 | + # --disable-gil | ||
| 1494 | + AC_MSG_CHECKING([for --disable-gil]) | ||
| 1495 | + AC_ARG_ENABLE([gil], | ||
| 1496 | + [AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default is no)])], | ||
| 1497 | + [AS_VAR_IF([enable_gil], [yes], [disable_gil=no], [disable_gil=yes])], [disable_gil=no] | ||
| 1498 | + ) | ||
| 1499 | + AC_MSG_RESULT([$disable_gil]) | ||
| 1500 | + | ||
| 1501 | + if test "$disable_gil" = "yes" | ||
| 1502 | + then | ||
| 1503 | + AC_DEFINE([Py_NOGIL], [1], | ||
| 1504 | + [Define if you want to disable the GIL]) | ||
| 1505 | + # Add "t" for "threaded" | ||
| 1506 | + ABIFLAGS="${ABIFLAGS}t" | ||
| 1507 | + fi | ||
| 1508 | + | ||
| 1492 | 1509 | # Check for --with-pydebug | |
| 1493 | 1510 | AC_MSG_CHECKING([for --with-pydebug]) | |
| 1494 | 1511 | AC_ARG_WITH([pydebug], | |
@@ -5669,6 +5686,7 @@ AC_C_BIGENDIAN | |||
| 5669 | 5686 | # | |
| 5670 | 5687 | # * The Python implementation (always 'cpython-' for us) | |
| 5671 | 5688 | # * The major and minor version numbers | |
| 5689 | + # * --disable-gil (adds a 't') | ||
| 5672 | 5690 | # * --with-pydebug (adds a 'd') | |
| 5673 | 5691 | # | |
| 5674 | 5692 | # Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc, | |
@@ -6947,21 +6965,6 @@ AC_ARG_ENABLE([test-modules], | |||
| 6947 | 6965 | AC_MSG_RESULT([$TEST_MODULES]) | |
| 6948 | 6966 | AC_SUBST([TEST_MODULES]) | |
| 6949 | 6967 | ||
| 6950 | - # Check for --disable-gil | ||
| 6951 | - # --disable-gil | ||
| 6952 | - AC_MSG_CHECKING([for --disable-gil]) | ||
| 6953 | - AC_ARG_ENABLE([gil], | ||
| 6954 | - [AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default is no)])], | ||
| 6955 | - [AS_VAR_IF([enable_gil], [yes], [disable_gil=no], [disable_gil=yes])], [disable_gil=no] | ||
| 6956 | - ) | ||
| 6957 | - AC_MSG_RESULT([$disable_gil]) | ||
| 6958 | - | ||
| 6959 | - if test "$disable_gil" = "yes" | ||
| 6960 | - then | ||
| 6961 | - AC_DEFINE([Py_NOGIL], [1], | ||
| 6962 | - [Define if you want to disable the GIL]) | ||
| 6963 | - fi | ||
| 6964 | - | ||
| 6965 | 6968 | # gh-109054: Check if -latomic is needed to get <pyatomic.h> atomic functions. | |
| 6966 | 6969 | # On Linux aarch64, GCC may require programs and libraries to be linked | |
| 6967 | 6970 | # explicitly to libatomic. Call _Py_atomic_or_uint64() which may require | |
| Back | FazBrowse Home | New Git URL |
0 commit comments