Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138582

QSystemLocaleData/Unix relocks environmentMutex many times for one update

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Core: Locales (i18n)
    • None
    • a21cb0282 (dev), e96f56a7d (6.10), de185ade0 (6.9), cc0aac404 (tqtc/lts-6.8), acc6b9335 (tqtc/lts-6.5)

    Description

      The readEnvironment() / initFromEnvironment() functions contain a lot of qgetenv() calls, each of which locks the environmentMutex again and copies data into QByteArrays.

      This happens at every application startup. And for LocaleChange, it can even deadlock if code under environmentMutex happens to end up in the system locale.

      A solution would be to go the qTzSet() way and move the code into qenvironmentvariables.cpp so we have access to environmentMutex and can lock it once for the whole operation (which might even remove the need for one or the other QByteArray, esp. if QTBUG-138558 has landed and QLocale can create itself without a UTF-16 sequence).

      The other would be to follow this epic and remove the environmentMutex, or give access to it to other TUs.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Eddy Edward Welbourne
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes