Class: Higgs::LockManager
- Inherits:
-
Object
- Object
- Higgs::LockManager
- Includes:
- Exceptions
- Defined in:
- lib/higgs/lock.rb
Overview
multi-thread lock manager
Direct Known Subclasses
Defined Under Namespace
Classes: CollisionCheckLockHandler, CollisionError, CriticalRegionLockHandler, Error, NoWorkLockHandler
Constant Summary collapse
- CVS_ID =
for ident(1)
'$Id: lock.rb 841 2008-12-24 09:23:20Z toki $'
Instance Method Summary collapse
- #exclusive ⇒ Object
-
#initialize ⇒ LockManager
constructor
A new instance of LockManager.
Constructor Details
#initialize ⇒ LockManager
Returns a new instance of LockManager.
90 91 92 |
# File 'lib/higgs/lock.rb', line 90 def initialize @tx_lock = ReadWriteLock.new end |
Instance Method Details
#exclusive ⇒ Object
94 95 96 97 98 99 100 |
# File 'lib/higgs/lock.rb', line 94 def exclusive r = nil @tx_lock.write_lock.synchronize{ r = yield } r end |