pybind11/tests/test_cmake_build
Sam Gross baa540ec34
fix: support free-threaded CPython with GIL disabled (#5148)
* Support free-threaded CPython (PEP 703)

Some additional locking is added in the free-threaded build when
`Py_GIL_DISABLED` is defined:

- Most accesses to internals are protected by a single mutex
- The registered_instances uses a striped lock to improve concurrency

Pybind11 modules can indicate support for running with the GIL disabled
by calling `set_gil_not_used()`.

* refactor: use PYBIND11_MODULE (#11)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* Address code review

* Suppress MSVC warning

* Changes from review

* style: pre-commit fixes

* `py::mod_gil_not_used()` suggestion.

* Update include/pybind11/pybind11.h

---------

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2024-06-18 13:54:38 -07:00
..
installed_embed chore: bump cmake to 3.29 (#5075) 2024-03-27 20:11:13 -04:00
installed_function chore: bump cmake to 3.29 (#5075) 2024-03-27 20:11:13 -04:00
installed_target chore: bump cmake to 3.29 (#5075) 2024-03-27 20:11:13 -04:00
subdirectory_embed chore: bump cmake to 3.29 (#5075) 2024-03-27 20:11:13 -04:00
subdirectory_function chore: bump cmake to 3.29 (#5075) 2024-03-27 20:11:13 -04:00
subdirectory_target chore: bump cmake to 3.29 (#5075) 2024-03-27 20:11:13 -04:00
CMakeLists.txt fix(cmake): upgrade maximum supported CMake version to 3.27 (#4786) 2023-12-14 14:36:45 -05:00
embed.cpp Add missing clang-tidy fixes (#3715) 2022-02-10 09:23:15 -08:00
main.cpp fix: support free-threaded CPython with GIL disabled (#5148) 2024-06-18 13:54:38 -07:00
test.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00