      function buildMessageHTML (message) {
        let html = ''
        const loggedInAccountId = window.trudeskSessionService.getUser()._id
        if (loggedInAccountId === undefined) return false
        let left = true
        if (message.owner._id.toString() === loggedInAccountId.toString()) {
          left = false
        }

        const image = message.owner.image === undefined ? 'defaultProfile.jpg' : message.owner.image

        if (left) {
          html += '<div class="message message-left">'
          html +=
            '<img class="profileImage" src="/uploads/users/' +
            image +
            '" data-userId="' +
            message.owner._id +
            '" data-uk-tooltip="{pos:\'left\', animation: false}" title="' +
            message.owner.fullname +
            ' - ' +
            moment(message.createdAt)
              .tz(helpers.getTimezone())
              .format(helpers.getShortDateFormat() + ' ' + helpers.getTimeFormat()) +
            '"/>'
          html += '<div class="message-body">'
          html += '<p>' + message.body + '</p>'
          html += '</div>'
          html += '</div>'
        } else {
          html += '<div class="message message-right">'
          html +=
            '<div class="message-body" data-uk-tooltip="{pos:\'right\', animation: false}" title="' +
            moment(message.createdAt)
              .tz(helpers.getTimezone())
              .format(helpers.getShortDateFormat() + ' ' + helpers.getTimeFormat()) +
            '">'
          html += '<p>' + message.body + '</p>'
          html += '</div>'
          html += '</div>'
        }

        return html
      }
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.