method
start_thread
v2_2_9 -
Show latest stable
- Class:
Rake::ThreadPool
start_thread()private
No documentation available.
# File lib/rake/thread_pool.rb, line 118
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
break unless process_queue_item
end
ensure
@threads_mon.synchronize do
@threads.delete Thread.current
stat :ended, :thread_count => @threads.count
@join_cond.broadcast if @threads.empty?
end
end
end
@threads << t
stat(
:spawned,
:new_thread => t.object_id,
:thread_count => @threads.count)
@total_threads_in_play = @threads.count if
@threads.count > @total_threads_in_play
end
end