def ShutdownThreads(data_source_thread, thread_pool):
 logger.info('An error occurred. Shutting down...')
 data_source_thread.exit_flag = True
 thread_pool.Shutdown()
 data_source_thread.join(timeout=3.0)
 if data_source_thread.isAlive():
  logger.warn('%s hung while trying to exit', data_source_thread.GetFriendlyName())

def ShutdownThreads ( data_source_thread , thread_pool ) : logger . info ( 'An error occurred. Shutting down...' ) data_source_thread . exit_flag = True thread_pool . Shutdown ( ) data_source_thread . join ( timeout = 3.0 ) if data_source_thread . isAlive ( ) : logger . warn ( '%s hung while trying to exit' , data_source_thread . GetFriendlyName ( ) )
shuts down the worker and data source threads .