You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: application.rb
    path of file: ./repos/rake/lib/rake
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require "optparse"

require "rake/task_manager"
require "rake/file_list"
require "rake/thread_pool"
require "rake/thread_his
    
    def run_with_threads
      thread_pool.gather_history if options.job_stats == :history

      yield

      thread_pool.join if defined?(@thread_pool)
      if options.job_stats
        stats = thread_pool.statistics
        puts "Maximum active threads: #{stats[:max_active_threads]} + main"
        puts "Total threads in play:  #{stats[:total_threads_in_play]} + main"
      end