.. versionadded:: 3.2
+ .. availability:: Unix.
+
.. function:: addaudithook(hook)
sys._stats_clear()
sys._stats_dump()
+ @test.support.cpython_only
+ @unittest.skipUnless(hasattr(sys, 'abiflags'), 'need sys.abiflags')
+ def test_disable_gil_abi(self):
+ abi_threaded = 't' in sys.abiflags
+ py_nogil = (sysconfig.get_config_var('Py_NOGIL') == 1)
+ self.assertEqual(py_nogil, abi_threaded)
+
@test.support.cpython_only
class UnraisableHookTest(unittest.TestCase):
--- /dev/null
+The experimental ``--disable-gil`` configure flag now includes "t" (for "threaded") in
+extension ABI tags.
#define PYD_DEBUG_SUFFIX ""
#endif
+#ifdef Py_NOGIL
+# define PYD_THREADING_TAG "t"
+#else
+# define PYD_THREADING_TAG ""
+#endif
+
#ifdef PYD_PLATFORM_TAG
-#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) "-" PYD_PLATFORM_TAG ".pyd"
+#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"
#else
-#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) ".pyd"
+#define PYD_TAGGED_SUFFIX PYD_DEBUG_SUFFIX ".cp" Py_STRINGIFY(PY_MAJOR_VERSION) Py_STRINGIFY(PY_MINOR_VERSION) PYD_THREADING_TAG ".pyd"
#endif
#define PYD_UNTAGGED_SUFFIX PYD_DEBUG_SUFFIX ".pyd"
enable_shared
with_static_libpython
enable_profiling
+enable_gil
with_pydebug
with_trace_refs
enable_pystats
with_ssl_default_suites
with_builtin_hashlib_hashes
enable_test_modules
-enable_gil
'
ac_precious_vars='build_alias
host_alias
no)
--enable-profiling enable C-level code profiling with gprof (default is
no)
+ --disable-gil enable experimental support for running without the
+ GIL (default is no)
--enable-pystats enable internal statistics gathering (default is no)
--enable-optimizations enable expensive, stable optimizations (PGO, etc.)
(default is no)
use big digits (30 or 15 bits) for Python longs
(default is 30)]
--disable-test-modules don't build nor install test modules
- --disable-gil enable experimental support for running without the
- GIL (default is no)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
ABIFLAGS=""
+# Check for --disable-gil
+# --disable-gil
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-gil" >&5
+printf %s "checking for --disable-gil... " >&6; }
+# Check whether --enable-gil was given.
+if test ${enable_gil+y}
+then :
+ enableval=$enable_gil; if test "x$enable_gil" = xyes
+then :
+ disable_gil=no
+else $as_nop
+ disable_gil=yes
+fi
+else $as_nop
+ disable_gil=no
+
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $disable_gil" >&5
+printf "%s\n" "$disable_gil" >&6; }
+
+if test "$disable_gil" = "yes"
+then
+
+printf "%s\n" "#define Py_NOGIL 1" >>confdefs.h
+
+ # Add "t" for "threaded"
+ ABIFLAGS="${ABIFLAGS}t"
+fi
+
# Check for --with-pydebug
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-pydebug" >&5
printf %s "checking for --with-pydebug... " >&6; }
#
# * The Python implementation (always 'cpython-' for us)
# * The major and minor version numbers
+# * --disable-gil (adds a 't')
# * --with-pydebug (adds a 'd')
#
# Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
printf "%s\n" "$TEST_MODULES" >&6; }
-# Check for --disable-gil
-# --disable-gil
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --disable-gil" >&5
-printf %s "checking for --disable-gil... " >&6; }
-# Check whether --enable-gil was given.
-if test ${enable_gil+y}
-then :
- enableval=$enable_gil; if test "x$enable_gil" = xyes
-then :
- disable_gil=no
-else $as_nop
- disable_gil=yes
-fi
-else $as_nop
- disable_gil=no
-
-fi
-
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $disable_gil" >&5
-printf "%s\n" "$disable_gil" >&6; }
-
-if test "$disable_gil" = "yes"
-then
-
-printf "%s\n" "#define Py_NOGIL 1" >>confdefs.h
-
-fi
-
# gh-109054: Check if -latomic is needed to get <pyatomic.h> atomic functions.
# On Linux aarch64, GCC may require programs and libraries to be linked
# explicitly to libatomic. Call _Py_atomic_or_uint64() which may require
AC_SUBST([ABIFLAGS])
ABIFLAGS=""
+# Check for --disable-gil
+# --disable-gil
+AC_MSG_CHECKING([for --disable-gil])
+AC_ARG_ENABLE([gil],
+ [AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default is no)])],
+ [AS_VAR_IF([enable_gil], [yes], [disable_gil=no], [disable_gil=yes])], [disable_gil=no]
+)
+AC_MSG_RESULT([$disable_gil])
+
+if test "$disable_gil" = "yes"
+then
+ AC_DEFINE([Py_NOGIL], [1],
+ [Define if you want to disable the GIL])
+ # Add "t" for "threaded"
+ ABIFLAGS="${ABIFLAGS}t"
+fi
+
# Check for --with-pydebug
AC_MSG_CHECKING([for --with-pydebug])
AC_ARG_WITH([pydebug],
#
# * The Python implementation (always 'cpython-' for us)
# * The major and minor version numbers
+# * --disable-gil (adds a 't')
# * --with-pydebug (adds a 'd')
#
# Thus for example, Python 3.2 built with wide unicode, pydebug, and pymalloc,
AC_MSG_RESULT([$TEST_MODULES])
AC_SUBST([TEST_MODULES])
-# Check for --disable-gil
-# --disable-gil
-AC_MSG_CHECKING([for --disable-gil])
-AC_ARG_ENABLE([gil],
- [AS_HELP_STRING([--disable-gil], [enable experimental support for running without the GIL (default is no)])],
- [AS_VAR_IF([enable_gil], [yes], [disable_gil=no], [disable_gil=yes])], [disable_gil=no]
-)
-AC_MSG_RESULT([$disable_gil])
-
-if test "$disable_gil" = "yes"
-then
- AC_DEFINE([Py_NOGIL], [1],
- [Define if you want to disable the GIL])
-fi
-
# gh-109054: Check if -latomic is needed to get <pyatomic.h> atomic functions.
# On Linux aarch64, GCC may require programs and libraries to be linked
# explicitly to libatomic. Call _Py_atomic_or_uint64() which may require