Class: Semian::ThreadSafe::Integer

Inherits:
Simple::Integer show all
Defined in:
lib/semian/simple_integer.rb

Instance Attribute Summary

Attributes inherited from Simple::Integer

#value

Instance Method Summary collapse

Methods inherited from Simple::Integer

#destroy, #reset

Constructor Details

#initializeInteger

Returns a new instance of Integer.



28
29
30
31
# File 'lib/semian/simple_integer.rb', line 28

def initialize(*)
  super
  @lock = Mutex.new
end

Instance Method Details

#incrementObject



33
34
35
# File 'lib/semian/simple_integer.rb', line 33

def increment(*)
  @lock.synchronize { super }
end