Method: ACE::FileMutex#with_read_lock

Defined in:
lib/ace/file_mutex.rb

#with_read_lockObject



11
12
13
14
15
16
17
18
# File 'lib/ace/file_mutex.rb', line 11

def with_read_lock
  fh = File.open(@lock_file, File::CREAT)
  fh.flock(File::LOCK_SH)
  yield
ensure
  fh.flock(File::LOCK_UN)
  fh.close
end