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):
633
633
"""
634
634
Joinable list of all non-daemon threads.
635
635
"""
636
- def __init__ (self ):
637
- self ._lock = threading .Lock ()
638
-
639
636
def append (self , thread ):
640
637
if thread .daemon :
641
638
return
642
- with self ._lock :
643
- super ().append (thread )
639
+ super ().append (thread )
644
640
645
641
def pop_all (self ):
646
- with self ._lock :
647
- self [:], result = [], self [:]
642
+ self [:], result = [], self [:]
648
643
return result
649
644
650
645
def join (self ):
651
646
for thread in self .pop_all ():
652
647
thread .join ()
653
648
654
649
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 )
661
655
662
656
663
657
class _NoThreads :
You can’t perform that action at this time.
0 commit comments