parameters: (self, thread_id)
docstring: Removes the worker with the given thread_id from the pool, and
          replaces it with a new worker thread.
  
          This should only be done for mis-behaving workers.
docstring_summary: Removes the worker with the given thread_id from the pool, and
          replaces it with a new worker thread.
docstring_tokens: Removes the worker with the given thread_id from the pool and replaces it with a new worker thread .
function: def kill_worker(self, thread_id):
          """
          Removes the worker with the given thread_id from the pool, and
          replaces it with a new worker thread.
  
          This should only be done for mis-behaving workers.
          """
          if killthread is None:
              raise RuntimeError(
                  "Cannot kill worker; killthread/ctypes not available")
          thread_obj = threading._active.get(thread_id)
          killthread.async_raise(thread_id, SystemExit)
          try:
              del self.worker_tracker[thread_id]
          except KeyError:
              pass
          self.logger.info('Killing thread %s', thread_id)
          if thread_obj in self.workers:
              self.workers.remove(thread_obj)
          self.dying_threads[thread_id] = (time.time(), thread_obj)
          self.add_worker_thread(message='Replacement for killed thread %s' % thread_id)
function_tokens: def kill_worker ( self , thread_id ) : if killthread is None : raise RuntimeError ( "Cannot kill worker; killthread/ctypes not available" ) thread_obj = threading . _active . get ( thread_id ) killthread . async_raise ( thread_id , SystemExit ) try : del self . worker_tracker [ thread_id ] except KeyError : pass self . logger . info ( 'Killing thread %s' , thread_id ) if thread_obj in self . workers : self . workers . remove ( thread_obj ) self . dying_threads [ thread_id ] = ( time . time ( ) , thread_obj ) self . add_worker_thread ( message = 'Replacement for killed thread %s' % thread_id )