Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions lib/rake/thread_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,13 @@ def process_queue_item #:nodoc:
false
end

def safe_thread_count
@threads_mon.synchronize do
@threads.count
end
end

def start_thread # :nodoc:
@threads_mon.synchronize do
next unless @threads.count < @max_active_threads

t = Thread.new do
begin
while safe_thread_count <= @max_active_threads
loop do
break unless process_queue_item
end
ensure
Expand Down