mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-22 21:24:41 +02:00
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 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
/* Set thread title. */
|
/* Set thread title. */
|
||||||
Utility::SetThreadName("Main Thread");
|
Utility::SetThreadName("Main Thread", false);
|
||||||
|
|
||||||
/* Set command-line arguments. */
|
/* Set command-line arguments. */
|
||||||
Application::SetArgC(argc);
|
Application::SetArgC(argc);
|
||||||
|
@ -514,10 +514,13 @@ static void WindowsSetThreadName(const char *name)
|
|||||||
}
|
}
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
void Utility::SetThreadName(const String& name)
|
void Utility::SetThreadName(const String& name, bool os)
|
||||||
{
|
{
|
||||||
m_ThreadName.reset(new String(name));
|
m_ThreadName.reset(new String(name));
|
||||||
|
|
||||||
|
if (!os)
|
||||||
|
return;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WindowsSetThreadName(name.CStr());
|
WindowsSetThreadName(name.CStr());
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
|
|
||||||
static String EscapeShellCmd(const String& s);
|
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);
|
static String GetThreadName(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user