Class: Higgs::ReadWriteLock::ChildLock

Inherits:
Object
  • Object
show all
Defined in:
lib/higgs/thread.rb

Direct Known Subclasses

ReadLock, WriteLock

Instance Method Summary collapse

Constructor Details

#initialize(rw_lock) ⇒ ChildLock

Returns a new instance of ChildLock.



380
381
382
# File 'lib/higgs/thread.rb', line 380

def initialize(rw_lock)
  @rw_lock = rw_lock
end

Instance Method Details

#synchronizeObject



384
385
386
387
388
389
390
391
392
# File 'lib/higgs/thread.rb', line 384

def synchronize
  lock
  begin
    r = yield
  ensure
    unlock
  end
  r
end