# File src/ruby_supportlib/phusion_passenger/vendor/daemon_controller/lock_file.rb, line 95
    def try_shared_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_SH | File::LOCK_NB)
          yield
        else
          raise AlreadyLocked
        end
      end
    end