      function loadMoreMessages () {
        if (!$enabled || $loading) return false
        if (_.isUndefined($convoId)) return false
        $loading = true
        $spinner.removeClass('uk-hidden')

        // Load Messages
        $.ajax({
          url: '/api/v1/messages/conversation/' + $convoId + '?page=' + $nextPage
        })
          .done(function (data) {
            $spinner.addClass('uk-hidden')
            var messages = data.messages
            if (_.size(messages) < 1) {
              $enabled = false
              $loading = false
              return false
            }

            var html = ''

            _.each(messages, function (m) {
              var h = buildMessageHTML(m)
              if (h.length > 0) html += h
            })

            var stage = $('<div></div>')
              .appendTo('body')
              .addClass('stage')
              .css({
                opacity: 0,
                visibility: 'hidden',
                position: 'absolute',
                top: '-9999em',
                left: '-9999em'
              })
              .append(html)
            var height = $(stage).outerHeight()
            $(stage).remove()

            $messagesWrapper.prepend(html)

            UIKit.$html.trigger('changed.uk.dom')
            $messageScroller.scrollTop(height, true)

            $nextPage = $nextPage + 1
            $loading = false
          })
          .error(function (err) {
            console.log(err)
          })
      }
The software utilizes multiple threads or processes to allow temporary access to a shared resource that can only be exclusive to one process at a time, but it does not properly synchronize these actions, which might cause simultaneous accesses of this resource by multiple threads or processes.