parameters: (t)
docstring: Register thread that must be joined() on shutdown
docstring_summary: Register thread that must be joined() on shutdown
docstring_tokens: Register thread that must be joined () on shutdown
function: def _add_shutdown_thread(t):
      """
      Register thread that must be joined() on shutdown
      """
      if _shutdown_flag:
          #TODO
          return
      with _shutdown_lock:
          if _shutdown_threads is None:
              # race condition check, don't log as we are deep into shutdown
              return
          # in order to prevent memory leaks, reap dead threads. The
          # last thread may not get reaped until shutdown, but this is
          # relatively minor
          for other in _shutdown_threads[:]:
              if not other.isAlive():
                  _shutdown_threads.remove(other)
          _shutdown_threads.append(t)
function_tokens: def _add_shutdown_thread ( t ) : if _shutdown_flag : #TODO return with _shutdown_lock : if _shutdown_threads is None : # race condition check, don't log as we are deep into shutdown return # in order to prevent memory leaks, reap dead threads. The # last thread may not get reaped until shutdown, but this is # relatively minor for other in _shutdown_threads [ : ] : if not other . isAlive ( ) : _shutdown_threads . remove ( other ) _shutdown_threads . append ( t )