From ae399232239db877ff1a67244e602013cce183c0 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Tue, 10 Aug 2021 16:37:14 +0000 Subject: [PATCH] Thread: set names on BSDs after 062566b67cb0 --- Common/Thread/ThreadUtil.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Common/Thread/ThreadUtil.cpp b/Common/Thread/ThreadUtil.cpp index dd8ea51ed7ca..738127929589 100644 --- a/Common/Thread/ThreadUtil.cpp +++ b/Common/Thread/ThreadUtil.cpp @@ -33,7 +33,7 @@ #include #endif -#if defined(__DragonFly__) || defined(__FreeBSD__) +#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) #include #elif defined(__NetBSD__) #include @@ -125,6 +125,10 @@ void SetCurrentThreadName(const char* threadName) { pthread_setname_np(pthread_self(), threadName); #elif defined(__APPLE__) pthread_setname_np(threadName); +#elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__OpenBSD__) + pthread_set_name_np(pthread_self(), threadName); +#elif defined(__NetBSD__) + pthread_setname_np(pthread_self(), "%s", (void*)threadName); #endif // Do nothing