SIGN IN SIGN UP

gh-116322: Enable the GIL while loading C extension modules (#118560)

Add the ability to enable/disable the GIL at runtime, and use that in
the C module loading code.

We can't know before running a module init function if it supports
free-threading, so the GIL is temporarily enabled before doing so. If
the module declares support for running without the GIL, the GIL is
later disabled. Otherwise, the GIL is permanently enabled, and will
never be disabled again for the life of the current interpreter.
B
Brett Simmers committed
853163d3b5fa56d54a47817642c804b5d0c9f8e5
Parent: 60bd111
Committed by GitHub <noreply@github.com> on 5/7/2024, 3:07:23 AM