Skip to content

Commit

Permalink
Avoid creating an unnecessary thread pool
Browse files Browse the repository at this point in the history
If the thread_pool does not already exist, there is no point in
creating a thread pool just to join the threads in it.

This is an alternative fix for ruby#440.
  • Loading branch information
jeremyevans committed Jul 18, 2022
1 parent 73a2116 commit e27ce40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rake/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def run_with_threads

yield

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

0 comments on commit e27ce40

Please sign in to comment.