Details
-
Bug
-
Resolution: Done
-
P5: Not important
-
5.11.0 Beta 3
-
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
For Gerrit Dashboard: QTBUG-67686 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
243976,1 | Correctly document value of QThread::currentThreadId on Windows | dev | qt/qtbase | Status: ABANDONED | +1 | 0 |
244018,3 | Correctly document value of QThread::currentThreadId on Windows | 5.12.0 | qt/qtbase | Status: MERGED | +2 | 0 |