lib/ohm/locking.rb
# Lock the object before executing the block, and release it once the block
# is done.
#
#   post = Order.create(customer: Customer.create)
#   post.mutex(0.01) do
#     # this block is in a mutex!
#   end
Lock the object before executing the block, and release it once the block
is done.


Lock the object before executing the block and release it once the block is done .
def spinlock(wait = 0.1)
      lock!(wait)
      yield
    ensure
      unlock!
    end
def spinlock ( wait = 0.1 ) lock! ( wait ) yield ensure unlock! end
Lock the object before executing the block, and release it once the block
is done.
Lock the object before executing the block and release it once the block is done .
wait
<not_specific>