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

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

    XMLWordPrintable

Details

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

    Description

      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()));
      }

       

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes