()
Drop any shutdown locks that don't correspond to running threads anymore.

    Calling this from time to time avoids an ever-growing _shutdown_locks
    set when Thread objects are not joined explicitly. See bpo-37788.

    This must be called with _shutdown_locks_lock acquired.
Drop any shutdown locks that don't correspond to running threads anymore.
Drop any shutdown locks that don t correspond to running threads anymore .
def _maintain_shutdown_locks():
    """
    Drop any shutdown locks that don't correspond to running threads anymore.

    Calling this from time to time avoids an ever-growing _shutdown_locks
    set when Thread objects are not joined explicitly. See bpo-37788.

    This must be called with _shutdown_locks_lock acquired.
    """
    # If a lock was released, the corresponding thread has exited
    to_remove = [lock for lock in _shutdown_locks if not lock.locked()]
    _shutdown_locks.difference_update(to_remove)
def _maintain_shutdown_locks ( ) : # If a lock was released, the corresponding thread has exited to_remove = [ lock for lock in _shutdown_locks if not lock . locked ( ) ] _shutdown_locks . difference_update ( to_remove )