Method: Bosh::ThreadPool#initialize

Defined in:
lib/common/thread_pool.rb

#initialize(options = {}) ⇒ ThreadPool

Returns a new instance of ThreadPool.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/common/thread_pool.rb', line 5

def initialize(options = {})
  @actions = []
  @lock = Mutex.new
  @cv = ConditionVariable.new
  @max_threads = options[:max_threads] || 1
  @available_threads = @max_threads
  @logger = options[:logger]
  @boom = nil
  @original_thread = Thread.current
  @threads = []
  @state = :open
end