File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -249,9 +249,9 @@ def shutdown(self, immediate=False):
249
249
self ._get ()
250
250
if self .unfinished_tasks > 0 :
251
251
self .unfinished_tasks -= 1
252
- self .not_empty .notify_all ()
253
252
# release all blocked threads in `join()`
254
253
self .all_tasks_done .notify_all ()
254
+ self .not_empty .notify_all ()
255
255
self .not_full .notify_all ()
256
256
257
257
# Override these methods to implement other queue organizations
Original file line number Diff line number Diff line change @@ -636,6 +636,23 @@ def test_shutdown_get_task_done_join(self):
636
636
637
637
self .assertEqual (results , [True ]* len (thrds ))
638
638
639
+ def test_shutdown_get_simple (self ):
640
+ def get ():
641
+ try :
642
+ results .append (q .get ())
643
+ except Exception as e :
644
+ results .append (e )
645
+
646
+ q = self .type2test ()
647
+ results = []
648
+ get_thread = threading .Thread (target = get )
649
+ get_thread .start ()
650
+ q .shutdown ()
651
+ get_thread .join (timeout = 0.01 )
652
+ self .assertFalse (get_thread .is_alive ())
653
+ self .assertEqual (len (results ), 1 )
654
+ self .assertIsInstance (results [0 ], self .queue .ShutDown )
655
+
639
656
640
657
class QueueTest (BaseQueueTestMixin ):
641
658
You can’t perform that action at this time.
0 commit comments