Charles-François Natali <[email protected]> added the comment:
> 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()
"""
----------
nosy: +neologix
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue14308>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com