changeset 6354:36ba64cc1208

threadname for debug versions only
author Alain Mazy <am@orthanc.team>
date Fri, 24 Oct 2025 15:51:24 +0200
parents 6bd98dfa6bb8
children 39176cabe65a
files OrthancFramework/Sources/Logging.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Sources/Logging.cpp	Fri Oct 24 15:05:31 2025 +0200
+++ b/OrthancFramework/Sources/Logging.cpp	Fri Oct 24 15:51:24 2025 +0200
@@ -30,7 +30,7 @@
 #include <cassert>
 #include <stdint.h>
 
-#if defined(__linux__)
+#if defined(__linux__) && !defined(NDEBUG)
   #include <pthread.h>
 #endif              
 
@@ -663,7 +663,7 @@
 
       threadNames_[id] = name;
 
-#if defined(__linux__)
+#if defined(__linux__) && !defined(NDEBUG)
       // set the thread name at "system" level too -> required to have the thread names visible in GDB !
       pthread_setname_np(pthread_self(), name.substr(0, 15).c_str());  // thread names are limited to 15 in Linux
 #endif