File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -633,31 +633,25 @@ class _Threads(list):
633633 """
634634 Joinable list of all non-daemon threads.
635635 """
636- def __init__ (self ):
637- self ._lock = threading .Lock ()
638-
639636 def append (self , thread ):
640637 if thread .daemon :
641638 return
642- with self ._lock :
643- super ().append (thread )
639+ super ().append (thread )
644640
645641 def pop_all (self ):
646- with self ._lock :
647- self [:], result = [], self [:]
642+ self [:], result = [], self [:]
648643 return result
649644
650645 def join (self ):
651646 for thread in self .pop_all ():
652647 thread .join ()
653648
654649 def reap (self ):
655- with self ._lock :
656- dead = [thread for thread in self if not thread .is_alive ()]
657- for thread in dead :
658- # should not happen, but safe to ignore
659- with contextlib .suppress (ValueError ):
660- self .remove (thread )
650+ dead = [thread for thread in self if not thread .is_alive ()]
651+ for thread in dead :
652+ # should not happen, but safe to ignore
653+ with contextlib .suppress (ValueError ):
654+ self .remove (thread )
661655
662656
663657class _NoThreads :
You can’t perform that action at this time.
0 commit comments