Message280711
| Author |
mdk |
| Recipients |
amaury.forgeotdarc, eric.araujo, flox, mdk, michaelahughes, pitrou |
| Date |
2016年11月13日.20:17:52 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1479068272.81.0.819653227047.issue10444@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
`daemon` flag cannot be changed after thread is started, the documentation is right and the code of the daemon setter is actually:
if self._started.is_set():
raise RuntimeError("cannot set daemon status of active thread")
But still it looks like a code review problem: all your daemonic threads should be created as daemonic.
Breaking the `daemon` semantics looks like a bug magnet: any future uses of non-daemonic threads (by an "experienced" developer of your team, specifically needing a non-daemon thread for a specific task) will behave as a deamon thread and the specific task may not be correctly executed (like, logging an exception?). |
|