From 8cf5f2c9a50fd8a910bbcb9ec92f853d43b29279 Mon Sep 17 00:00:00 2001 From: Rick V Date: Thu, 1 Aug 2019 23:42:32 -0500 Subject: [PATCH] fix thread naming on windows --- llarp/util/threading.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llarp/util/threading.cpp b/llarp/util/threading.cpp index 84cb16b2e..77d687011 100644 --- a/llarp/util/threading.cpp +++ b/llarp/util/threading.cpp @@ -32,7 +32,7 @@ namespace llarp // API present upstream since v2.11.3 and imported downstream // in CR 8158 // We only use the native function on Microsoft C++ builds -#elif defined(__linux__) || defined(__sun) || defined(__MINGW32__) +#elif defined(__linux__) || defined(__sun) const int rc = pthread_setname_np(pthread_self(), name.c_str()); #else #error "unsupported platform" @@ -45,6 +45,8 @@ namespace llarp #endif #elif _MSC_VER ::SetThreadName(::GetCurrentThreadId(), name.c_str()); +#elif __MINGW32__ + const int rc = pthread_setname_np(pthread_self(), name.c_str()); #else LogInfo("Thread name setting not supported on this platform"); (void)name;