Message158754
| Author |
neologix |
| Recipients |
Dustin.Kirkland, cooyeah, neologix, pitrou, sbt |
| Date |
2012年04月19日.21:11:13 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334869873.87.0.911791812043.issue14308@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> Here is a complete patch + tests for 2.7.
I like the test.
However there's something I find strange with the patch:
"""
diff --git a/Lib/threading.py b/Lib/threading.py
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -887,7 +887,7 @@ def _after_fork():
ident = _get_ident()
thread._Thread__ident = ident
new_active[ident] = thread
- else:
+ elif not isinstance(thread, _DummyThread):
# All the others are already stopped.
thread._Thread__stop()
"""
Is it really the caller's job to check that the thread is not a dummy thread?
IMO it should be _DummyThread's stop() method that does the right thing, either by overriding Thread's stop() method in _DummyThread or by puting the check inside Thread.stop(), like what's done inside thread._reset_internal_locks():
"""
if hasattr(self, '_Thread__block'): # DummyThread deletes self.__block
self.__block.__init__()
self.__started._reset_internal_locks()
""" |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月19日 21:11:13 | neologix | set | recipients:
+ neologix, pitrou, cooyeah, sbt, Dustin.Kirkland |
| 2012年04月19日 21:11:13 | neologix | set | messageid: <1334869873.87.0.911791812043.issue14308@psf.upfronthosting.co.za> |
| 2012年04月19日 21:11:13 | neologix | link | issue14308 messages |
| 2012年04月19日 21:11:13 | neologix | create |
|