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):
249249                    self ._get ()
250250                    if  self .unfinished_tasks  >  0 :
251251                        self .unfinished_tasks  -=  1 
252-                 self .not_empty .notify_all ()
253252                # release all blocked threads in `join()` 
254253                self .all_tasks_done .notify_all ()
254+             self .not_empty .notify_all ()
255255            self .not_full .notify_all ()
256256
257257    # 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):
636636
637637        self .assertEqual (results , [True ]* len (thrds ))
638638
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+ 
639656
640657class  QueueTest (BaseQueueTestMixin ):
641658
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments