method

start_thread

Importance_0
v2_2_9 - Show latest stable - 0 notes - Class: ThreadPool
start_thread() private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# 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
Register or log in to add new notes.