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