0
0

Hi,

Would it be possible for Fmod to add names to any threads it creates for easier debugging?

The code to add a name to a thread is as follows:

[code:chjx7ide]struct THREADNAME_INFO
{
DWORD dwType; // must be 0x1000
LPCSTR szName; // pointer to name (in user addr space)
DWORD dwThreadID; // thread ID (-1=caller thread)
DWORD dwFlags; // reserved for future use, must be zero
};

void SetThreadName( const char* name, int threadId )
{
THREADNAME_INFO info;
info.dwType = 0x1000;
info.szName = name;
info.dwThreadID = threadId;
info.dwFlags = 0;

__try
{
RaiseException(0x406D1388, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info);
}
__except (EXCEPTION_CONTINUE_EXECUTION)
{
}
}
[/code:chjx7ide]

The above code will work on Windows and Xbox 360 (and, I presume, Xbox 1 too.)

Cheers,
James

  • You must to post comments
0
0

We already have this in the L version of the library. It cannot be used in release as it throws an unhandled exception

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.