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 #440.
  • Loading branch information
jeremyevans authored and hsbt committed Jul 19, 2022
1 parent 2cda976 commit 98dcc9d
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 98dcc9d

Please sign in to comment.