Skip to content

Commit 7bae58b

Browse files
committed
Grow until @min_length is reached
1 parent 67c3beb commit 7bae58b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/concurrent/executor/ruby_thread_pool_executor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def ns_kill_execution
201201
# tries to assign task to a worker, tries to get one from @ready or to create new one
202202
# @return [true, false] if task is assigned to a worker
203203
def ns_assign_worker(*args, &task)
204-
worker = @ready.pop || ns_add_busy_worker
204+
worker = (@ready.pop if @pool.size >= @min_length) || ns_add_busy_worker
205205
if worker
206206
worker << [task, args]
207207
true

0 commit comments

Comments
 (0)