]> git.sesse.net Git - casparcg/commitdiff
[linux] Don't overwrite thread name if it is already set.
authorHelge Norberg <helge.norberg@svt.se>
Mon, 3 Oct 2016 20:21:39 +0000 (22:21 +0200)
committerHelge Norberg <helge.norberg@svt.se>
Mon, 3 Oct 2016 20:21:39 +0000 (22:21 +0200)
common/os/linux/signal_handlers.cpp

index 3ab4a7332266fa792ea095041ec9e45f193b779a..27d74b6efca9e9c33f8ab6a48bc3a7f42c501d75 100644 (file)
@@ -54,10 +54,12 @@ void ensure_gpf_handler_installed_for_thread(
 {
        static const int MAX_LINUX_THREAD_NAME_LEN = 15;
        static auto install = []() { do_install_handlers(); return 0; } ();
+
+       auto& for_thread = get_thread_info();
        
-       if (thread_description)
+       if (thread_description && for_thread.name.empty())
        {
-               get_thread_info().name = thread_description;
+               for_thread.name = thread_description;
 
                if (std::strlen(thread_description) > MAX_LINUX_THREAD_NAME_LEN)
                {