[issue15751] Support subinterpreters in the GIL state API

Antoine Pitrou report at bugs.python.org
Tue Aug 28 18:47:57 CEST 2012


Antoine Pitrou added the comment:

Le mardi 28 août 2012 à 14:12 +0000, Nick Coghlan a écrit :
> old_interp = PyGILState_SwitchInterpreter(target_interp);
> old_gil = PyGILState_Ensure();
> /* Call into Python using target_interp */
> PyGILState_Release(old_gil);
> PyGILState_SwitchInterpreter(old_interp); /* May not be needed in the mod_wsgi case, since it knows it is making the outermost call into the PyGILState_* APIs */

Why wouldn't it be simply written:

old_gil = PyGILState_EnsureEx(target_interp);
/* Call into Python using target_interp */
PyGILState_Release(old_gil);

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15751>
_______________________________________


More information about the Python-bugs-list mailing list