base: Don't set thread name for the first thread.

This commit is contained in:
Gunnar Beutner 2013-09-03 15:44:31 +02:00
parent 4be2105584
commit e05f270459
3 changed files with 6 additions and 3 deletions

View File

@ -166,7 +166,7 @@ int main(int argc, char **argv)
#endif /* _WIN32 */
/* Set thread title. */
Utility::SetThreadName("Main Thread");
Utility::SetThreadName("Main Thread", false);
/* Set command-line arguments. */
Application::SetArgC(argc);

View File

@ -514,10 +514,13 @@ static void WindowsSetThreadName(const char *name)
}
#endif /* _WIN32 */
void Utility::SetThreadName(const String& name)
void Utility::SetThreadName(const String& name, bool os)
{
m_ThreadName.reset(new String(name));
if (!os)
return;
#ifdef _WIN32
WindowsSetThreadName(name.CStr());
#endif /* _WIN32 */

View File

@ -92,7 +92,7 @@ public:
static String EscapeShellCmd(const String& s);
static void SetThreadName(const String& name);
static void SetThreadName(const String& name, bool os = true);
static String GetThreadName(void);
private: