[issue38680] PyGILState_Release does not release gil correctly, resulting in deadlock

123 wlpha report at bugs.python.org
Sun Nov 3 23:48:28 EST 2019


New submission from 123 wlpha <hackjajk at gmail.com>:

PyGILState_Release does not really release gil, causing the next PyGILState_Ensure deadlock, now you need to call if (PyGILState_Check () > 0) {PyEval_SaveThread ();}


```
auto gil = PyGILState_Ensure();

// call c api

PyGILState_Release (gil);
if (PyGILState_Check () > 0) {
   PyEval_SaveThread ();
}
    
```

----------
components: Interpreter Core
messages: 355921
nosy: 123 wlpha
priority: normal
severity: normal
status: open
title: PyGILState_Release does not release gil correctly, resulting in deadlock
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38680>
_______________________________________


More information about the Python-bugs-list mailing list