]> granicus.if.org Git - icinga2/commitdiff
base: Don't set thread name for the first thread.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 3 Sep 2013 13:44:31 +0000 (15:44 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 3 Sep 2013 13:44:31 +0000 (15:44 +0200)
icinga-app/icinga.cpp
lib/base/utility.cpp
lib/base/utility.h

index b7dca724a9372448a3230438b99f98b21c1f3914..397190abdfec90d8bc0be65203787bbe53be5fd8 100644 (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);
index 911c867c68f6db8d544537faccab7421003f09ef..4ceb16327b402362fa2958c2e5afa701f88a066a 100644 (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 */
index 94d882890d7a48424b315a22c3efa447e0ecb2b5..fa5439e1c7554104c6d66eaf52a9fa67d36afa3a 100644 (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: