From 874e9eeac6f7b439a6f19ee80fd657573867e244 Mon Sep 17 00:00:00 2001 From: Reinder Feenstra Date: Mon, 18 Apr 2022 22:40:15 +0200 Subject: [PATCH] fix: macos: pthread_setname_np is different --- server/src/utils/setthreadname.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/utils/setthreadname.hpp b/server/src/utils/setthreadname.hpp index 9d4f9c0b..23ea18a6 100644 --- a/server/src/utils/setthreadname.hpp +++ b/server/src/utils/setthreadname.hpp @@ -33,7 +33,11 @@ inline void setThreadName(const char* name) { #if __has_include() if constexpr(std::is_same_v) + #ifdef __APPLE__ + pthread_setname_np(name); + #else pthread_setname_np(pthread_self(), name); + #endif #endif #ifdef WIN32 // TODO: