class Puma::ThreadPool

def reap

spawned counter so that new healthy threads could be created again.
If there are dead threads in the pool make them go away while decreasing
def reap
  with_mutex do
    dead_workers = @workers.reject(&:alive?)
    dead_workers.each do |worker|
      worker.kill
      @spawned -= 1
    end
    @workers.delete_if do |w|
      dead_workers.include?(w)
    end
  end
end