Object
Minimalistic implementation of a synchronized fixnum value, designed after (but not implementing the entire API of!)
@note Designed to be intentionally minimalistic and only cover Bunny’s needs.
@api public
# File lib/bunny/concurrent/atomic_fixnum.rb, line 65 def ==(m) @mutex.synchronize { @n == m } end
# File lib/bunny/concurrent/atomic_fixnum.rb, line 69 def ===(v) @mutex.synchronize { @n === v } end
# File lib/bunny/concurrent/atomic_fixnum.rb, line 57 def decrement @mutex.synchronize do @n = @n - 1 end end
# File lib/bunny/concurrent/atomic_fixnum.rb, line 19 def get @mutex.synchronize do @n end end
# File lib/bunny/concurrent/atomic_fixnum.rb, line 39 def get_and_add(i) @mutex.synchronize do v = @n @n = @n + i v end end
# File lib/bunny/concurrent/atomic_fixnum.rb, line 48 def get_and_increment @mutex.synchronize do v = @n @n = @n + 1 v end end
# File lib/bunny/concurrent/atomic_fixnum.rb, line 31 def increment @mutex.synchronize do @n = @n + 1 end end
Generated with the Darkfish Rdoc Generator 2.