Марк Коренберг <socketp...@gmail.com> added the comment:
> Why do you say it "hangs"? It doesn't hang, it just waits for you to > call serve_forever(): it's not a bug, it's actually a feature. Okay, for my case, How I should correctly terminate thread? Conditions: 1. signal may appear at any time 2. thread may become non-alive in any time - either before server_forever (due to exception) or after. So, after breaking main loop, I should correctly "terminate" thread. I can not say if thread is running. checking isAlive is racy. Even when thread is alive, this is unknown if server_forever was called. Even if serve_forever was not called, we should not rely on calling this ones, because thread may be interrupted by exception before calling serve_forever. Once again: why not to add patch suggested by Petri Lehtinen ? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12463> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com