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.



30
31
32
33
# File 'lib/semian/simple_integer.rb', line 30

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

Instance Method Details

#incrementObject



35
36
37
# File 'lib/semian/simple_integer.rb', line 35

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