fn gil_is_acquired() -> bool
Expand description
Checks whether the GIL is acquired.
Note: This uses pyo3’s internal count rather than PyGILState_Check for two reasons:
- for performance
- PyGILState_Check always returns 1 if the sub-interpreter APIs have ever been called, which could lead to incorrect conclusions that the GIL is held.