Class: HammerBuilder::SynchronizedPool
- Defined in:
- lib/hammer_builder/pool.rb
Instance Attribute Summary
Attributes inherited from Pool
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(klass) ⇒ SynchronizedPool
constructor
A new instance of SynchronizedPool.
- #release(builder) ⇒ Object
Methods inherited from Pool
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
#get ⇒ Object
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 |