Class: Htmless::SynchronizedPool

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

Instance Attribute Summary

Attributes inherited from Pool

#klass

Instance Method Summary (collapse)

Methods inherited from Pool

#size

Constructor Details

- (SynchronizedPool) initialize(klass)

A new instance of SynchronizedPool



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

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

Instance Method Details

- (Object) get



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

def get
  @mutex.synchronize { super }
end

- (Object) release(builder)



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

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