Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Should a custom QtMessageHandler be thread-safe ?
QtWS25 Last Chance

Should a custom QtMessageHandler be thread-safe ?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rcari
    wrote on last edited by
    #1

    Hi all, I've been digging through the documentation and can't find if a custom QtMessageHandler has to be thread-safe in its implementation.
    Are the thread-safety issues already taken care of by the framework ?
    Thanks in advance for your answers!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIR, you have to take care of thread safety. The documentation states that when nothing is said about thread safety/reentrance then it should be considered as not safe.

      IIRC, qDebug uses a QTextStream which is not thread safe

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved