Method: Rake::Application#run_with_threads

Defined in:
lib/rake/application.rb

#run_with_threadsObject

Run the given block with the thread startup and shutdown.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/rake/application.rb', line 112

def run_with_threads
  thread_pool.gather_history if options.job_stats == :history

  yield

  thread_pool.join
  if options.job_stats
    stats = thread_pool.statistics
    puts "Maximum active threads: #{stats[:max_active_threads]}"
    puts "Total threads in play:  #{stats[:total_threads_in_play]}"
  end
  ThreadHistoryDisplay.new(thread_pool.history).show if
    options.job_stats == :history
end