SetThreadName does not set thread name with Visual Studio 2005, when used as below:
DWORD threadId;
HANDLE handle = CreateThread(NULL, stackSize, ThreadFunction,
ThreadParam, CREATE_SUSPENDED, &threadId);
if (handle)
{
SetThreadName(threadId, "NiceName");
ResumeThread(handle);
}
After opening the Threads window, instead of NiceName I can see the name of the ThreadFunction there. Other tools (like Intel Parallel Inspector) use NiceName as expected.
Is something wrong with the code above?
Does the code work with Visual Studio 2008 or 2010 editions?