libpyxruntime: Fix deadlock in pygil_ensure()
pygil_ensure() was taking pyexitedMu and then GIL, which can deadlock via AB BA scenario if pygil_ensure() is also called in another thread with GIL already held. -> Fix it by always taking GIL with pyexitedMu released. Without the fix the test added always hangs with thread backend, e.g. like this: golang/pyx/runtime_test.py::test_pyx_pyfunc_vs_gil_deadlock STUCK terminate called after throwing an instance of 'golang::PanicError' what(): STUCK Fatal Python error: Aborted The bug was introduced in b073f6df (time: Move/Port timers to C++/Pyx nogil).
Showing
golang/pyx/_runtime_test.pyx
0 → 100644
golang/pyx/runtime_test.py
0 → 100644
Please register or sign in to comment