mirror of https://github.com/encounter/SDL.git
windows: Change the default on SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING.
It's easier for Visual Studio users that want this information to turn it on or live without it, than it is to explain why every debugger that isn't Visual Studio crashes out here. Eventually SetThreadDescription() will be the thing everyone uses anyhow. Fixes Bugzilla #3645. (and several others).
This commit is contained in:
parent
d844487799
commit
6d661cab7b
|
@ -726,13 +726,18 @@ extern "C" {
|
||||||
#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT"
|
#define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Tell SDL not to name threads on Windows.
|
* \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
|
||||||
|
* The 0x406D1388 Exception is a trick used to inform Visual Studio of a
|
||||||
|
* thread's name, but it tends to cause problems with other debuggers,
|
||||||
|
* and the .NET runtime. Note that SDL 2.0.6 and later will still use
|
||||||
|
* the (safer) SetThreadDescription API, introduced in the Windows 10
|
||||||
|
* Creators Update, if available.
|
||||||
*
|
*
|
||||||
* The variable can be set to the following values:
|
* The variable can be set to the following values:
|
||||||
* "0" - SDL will raise the 0x406D1388 Exception to name threads.
|
* "0" - SDL will raise the 0x406D1388 Exception to name threads.
|
||||||
* This is the default behavior of SDL <= 2.0.4. (default)
|
* This is the default behavior of SDL <= 2.0.4.
|
||||||
* "1" - SDL will not raise this exception, and threads will be unnamed.
|
* "1" - SDL will not raise this exception, and threads will be unnamed. (default)
|
||||||
* For .NET languages this is required when running under a debugger.
|
* This is necessary with .NET languages or debuggers that aren't Visual Studio.
|
||||||
*/
|
*/
|
||||||
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,7 @@ SDL_SYS_SetupThread(const char *name)
|
||||||
THREADNAME_INFO inf;
|
THREADNAME_INFO inf;
|
||||||
|
|
||||||
/* C# and friends will try to catch this Exception, let's avoid it. */
|
/* C# and friends will try to catch this Exception, let's avoid it. */
|
||||||
if (SDL_GetHintBoolean(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, SDL_FALSE)) {
|
if (SDL_GetHintBoolean(SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING, SDL_TRUE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue