Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(972)

Unified Diff: Lib/threading.py

Issue 11870: test_3_join_in_forked_from_thread() of test_threading hangs 1 hour on "x86 Ubuntu Shared 3.x"
Patch Set: Created 1 year, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1047,21 +1047,18 @@
current = current_thread()
with _active_limbo_lock:
for thread in _active.values():
+ # Any lock/condition variable may be currently locked or in invalid
+ # state, so we reinitialize them.
+ thread._reset_internal_locks()
if thread is current:
# There is only one active thread. We reset the ident to
# its new value since it can have changed.
ident = get_ident()
thread._ident = ident
- # Any condition variables hanging off of the active thread may
- # be in an invalid state, so we reinitialize them.
- thread._reset_internal_locks()
new_active[ident] = thread
else:
# All the others are already stopped.
- # We don't call _Thread__stop() because it tries to acquire
- # thread._Thread__block which could also have been held while
- # we forked.
- thread._stopped = True
+ thread._stop()
_limbo.clear()
_active.clear()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7