Steve Dower <steve.do...@python.org> added the comment:

At a glance, it looks like ENTER_PYTHON will *restore* the GIL on the current 
thread, but it may be coming in on a thread that's never seen the GIL before.

"The GIL" is actually the Python thread state, which is actually a per-thread 
data structure that's either active/locked or inactive/unlocked. If the current 
thread doesn't have a thread state, PyGILState_Ensure will create one, while 
ENTER_PYTHON will not.

So the underlying issue is probably that the callbacks are coming in from a 
thread that they shouldn't be, and really ought to be marshalled back into the 
correct event loop first.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40075>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to