mirror of https://github.com/Icinga/icinga2.git
base: Don't set thread name for the first thread.
This commit is contained in:
parent
4be2105584
commit
e05f270459
|
@ -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);
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue