Class: HammerBuilder::SynchronizedPool

Inherits:
Pool
  • Object
show all
Defined in:
lib/hammer_builder/pool.rb

Instance Attribute Summary

Attributes inherited from Pool

#klass

Instance Method Summary collapse

Methods inherited from Pool

#size

Constructor Details

#initialize(klass) ⇒ SynchronizedPool

Returns a new instance of SynchronizedPool.



58
59
60
61
# File 'lib/hammer_builder/pool.rb', line 58

def initialize(klass)
  super(klass)
  @mutex = Mutex.new
end

Instance Method Details

#getObject



63
64
65
# File 'lib/hammer_builder/pool.rb', line 63

def get
  @mutex.synchronize { super }
end

#release(builder) ⇒ Object



67
68
69
# File 'lib/hammer_builder/pool.rb', line 67

def release(builder)
  @mutex.synchronize { super(builder) }
end