Skip to content

Commit 15aa9ab

Browse files
authored
Merge pull request #636 from DormancyWang/remove_unnecessary_condition_check
Remove useless condition check
2 parents 0fdacef + fb5277a commit 15aa9ab

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

lib/rake/thread_pool.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,13 @@ def process_queue_item #:nodoc:
108108
false
109109
end
110110

111-
def safe_thread_count
112-
@threads_mon.synchronize do
113-
@threads.count
114-
end
115-
end
116-
117111
def start_thread # :nodoc:
118112
@threads_mon.synchronize do
119113
next unless @threads.count < @max_active_threads
120114

121115
t = Thread.new do
122116
begin
123-
while safe_thread_count <= @max_active_threads
117+
loop do
124118
break unless process_queue_item
125119
end
126120
ensure

0 commit comments

Comments
 (0)