Method: Rake::ThreadPool#initialize

Defined in:
lib/rake/thread_pool.rb

#initialize(thread_count) ⇒ ThreadPool

Creates a ThreadPool object. The thread_count parameter is the size of the pool.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rake/thread_pool.rb', line 12

def initialize(thread_count)
  @max_active_threads = [thread_count, 0].max
  @threads = Set.new
  @threads_mon = Monitor.new
  @queue = Queue.new
  @join_cond = @threads_mon.new_cond

  @history_start_time = nil
  @history = []
  @history_mon = Monitor.new
  @total_threads_in_play = 0
end