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( = {}) @actions = [] @lock = Mutex.new @cv = ConditionVariable.new @max_threads = [:max_threads] || 1 @available_threads = @max_threads @logger = [:logger] @boom = nil @original_thread = Thread.current @threads = [] @state = :open end |