Message141808
| Author |
socketpair |
| Recipients |
giampaolo.rodola, neologix, petri.lehtinen, pitrou, santoso.wijaya, socketpair |
| Date |
2011年08月09日.03:08:42 |
| SpamBayes Score |
1.287696e-05 |
| Marked as misclassified |
No |
| Message-id |
<1312859323.82.0.218610556782.issue12463@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> 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 ? |
|