INADA Naoki added the comment: > Where *exactly*?
See attached patch. But python with this patch can deadlock in other state. Main thread wait GIL but no other living threads have GIL. It seems caused by other issue around finalization and multithreading. > Py_FinalizeEx() first calls wait_for_thread_shutdown() and *then* sets > _Py_Finalizing to tstate. > Does wait_for_thread_shutdown() complete on this bug? Yes. wait_for_thread_shutdown() waits only daemon threads. After _Py_Finalizing = tstate, main thread calls many __del__ methods while shutdown. If one of them starts new thread, this deadlock happens. ---------- keywords: +patch Added file: http://bugs.python.org/file45659/28673-fix-deadlock.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28673> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com