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

Wrong "warning" text in the QThread::currentThreadId() documentation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P5: Not important P5: Not important
    • 5.12.0 Beta 4
    • 5.11.0 Beta 3
    • Documentation
    • None

      The documentation says (doc):

      Warning: On Windows, the returned value is a pseudo-handle for the current thread. It can't be used for numerical comparison. i.e., this function returns the DWORD (Windows-Thread ID) returned by the Win32 function getCurrentThreadId(), not the HANDLE (Windows-Thread HANDLE) returned by the Win32 function getCurrentThread().


      However, GetCurrentThreadId (with a capital G, btw) function returns the thread identifier of the calling thread (MSDN) and GetCurrentThread (with a capital G, one more time) function returns a pseudo handle for the calling thread (MSDN).

      QThread::currentThreadId really does return what GetCurrentThreadId returns:

      Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
      {
          return reinterpret_cast<Qt::HANDLE>(quintptr(GetCurrentThreadId()));
      }

       

        For Gerrit Dashboard: QTBUG-67686
        # Subject Branch Project Status CR V

            vhilshei Volker Hilsheimer
            anton.n.petrov Anton Petrov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes