Did you know ... | Search Documentation: |
Predicate py_gil_owner/1 |
Note that this predicate returns the Prolog threads that locked the GIL. It is however possible that Python releases the GIL, for example if it performs a blocking call. In this scenario, some other thread or no thread may hold the gil.