SetThreadName does not work with Visual Studio 2005

SetThreadName does not set the thread name in Visual Studio 2005 when used 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 see the name ThreadFunction. Other tools (like Intel Parallel Inspector) use NiceName as expected.

  • Is there something wrong with the code above?

  • Does the code work with the release of Visual Studio 2008 or 2010?

0
source share
1 answer

, , Visual Studio , , . , , SetThreadName .

, Visual Studio .

0

Source: https://habr.com/ru/post/1741006/


All Articles