src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb
def exclusive_lock
      File.open(@filename, 'w') do |f|
        if Fcntl.const_defined? :F_SETFD
          f.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
        end
        f.flock(File::LOCK_EX)
        yield
      end
    end
# Obtain an exclusive lock on the lock file, yield the given block,
# then unlock the lockfile. If the lock file was already locked (whether
# shared or exclusively) by another process/thread then this method will
# block until the lock file has been unlocked.
#
# The lock file *must* be writable, otherwise an Errno::EACCESS
# exception will be raised.
Obtain an exclusive lock on the lock file, yield the given block,
then unlock the lockfile. If the lock file was already locked (whether
shared or exclusively) by another process/thread then this method will
block until the lock file has been unlocked.

The lock file *must* be writable, otherwise an Errno::EACCESS
exception will be raised.
Obtain an exclusive lock on the lock file yield the given block then unlock the lockfile . If the lock file was already locked ( whether shared or exclusively ) by another process / thread then this method will block until the lock file has been unlocked . The lock file * must * be writable otherwise an Errno :: EACCESS exception will be raised .
def exclusive_lock
      File.open(@filename, 'w') do |f|
        if Fcntl.const_defined? :F_SETFD
          f.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
        end
        f.flock(File::LOCK_EX)
        yield
      end
    end
def exclusive_lock File . open ( @filename , 'w' ) do | f | if Fcntl . const_defined? :F_SETFD f . fcntl ( Fcntl :: F_SETFD , Fcntl :: FD_CLOEXEC ) end f . flock ( File :: LOCK_EX ) yield end end
Obtain an exclusive lock on the lock file, yield the given block,
then unlock the lockfile.
Obtain an exclusive lock on the lock file yield the given block then unlock the lockfile .