File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -161,17 +161,18 @@ ExecutorPool *ExecutorPool::get(void) {
161161    return  tmp;
162162}
163163
164- void  ExecutorPool::shutdown (void ) {
164+ bool  ExecutorPool::shutdown (void ) {
165165    LockHolder lh (initGuard);
166166    auto * tmp = instance.load ();
167167    if  (tmp != nullptr ) {
168-         for  ( auto  &taskable :  tmp->taskOwners ) {
169-             tmp-> _unregisterTaskable (* reinterpret_cast <Taskable *>(taskable), 
170-                                       true ) ;
168+         if  ( tmp->taskOwners . size () !=  0 ) {
169+             //  Open taskables 
170+             return   false ;
171171        }
172172        delete  tmp;
173173        instance = nullptr ;
174174    }
175+     return  true ;
175176}
176177
177178ExecutorPool::ExecutorPool (size_t  maxThreads, size_t  nTaskSets,
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ class ExecutorPool {
117117
118118    static  ExecutorPool *get (void );
119119
120-     static  void  shutdown (void );
120+     static  bool  shutdown (void );
121121
122122protected: 
123123
Original file line number Diff line number Diff line change @@ -2022,7 +2022,10 @@ fdb_status FdbEngine::destroyInstance() {
20222022        BgFlusher::destroyBgFlusher ();
20232023        fdb_status ret = FileMgr::shutdown ();
20242024        if  (ret == FDB_RESULT_SUCCESS) {
2025-             ExecutorPool::shutdown ();
2025+             if  (!ExecutorPool::shutdown ()) {
2026+                 //  Open taskables
2027+                 return  FDB_RESULT_FILE_IS_BUSY;
2028+             }
20262029            //  Shutdown HBtrie's memory pool
20272030            HBTrie::shutdownMemoryPool ();
20282031            delete  tmp;
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments