STINNER Victor <vstin...@python.org> added the comment:

trip_signal() has another problem. If pending->finishing is non-zero, 
_PyEval_AddPendingCall() uses the C API whereas the current thread may not hold 
the GIL. That's forbidden by the C API.

The more I think about it, the more I think that pending->finishing is fragile 
and should be removed.

I understood that pending->finishing was added to workaround crashes during 
Python finalization. I fixed multiple crashes related to daemon threads during 
Python finalization in bpo-39877. Maybe the bugs that I fixed were the ones 
which pending->finishing was supposed to work around.

----------

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

Reply via email to