# File src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb, line 113
    def try_exclusive_lock
      File.open(@filename, 'w') do |f|
        if Fcntl.const_defined? :F_SETFD
          f.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)
        end
        if f.flock(File::LOCK_EX | File::LOCK_NB)
          yield
        else
          raise AlreadyLocked
        end
      end
    end