Skip to content

Commit 98dcc9d

Browse files
jeremyevanshsbt
authored andcommitted
Avoid creating an unnecessary thread pool
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.
1 parent 2cda976 commit 98dcc9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rake/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def run_with_threads
124124

125125
yield
126126

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

0 commit comments

Comments
 (0)