From 5803d921ae63f5358f7bc2733f982f8870fa5f14 Mon Sep 17 00:00:00 2001 From: Kris Moore Date: Fri, 1 May 2015 22:05:00 +0200 Subject: [PATCH] libobs: Fix thread naming on FreeBSD Add the relevant header file needed on FreeBSD and utilize yet another ifdef to call pthread_set_name_np as the function name differs from those on the other platforms. --- libobs/util/threading-posix.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libobs/util/threading-posix.c b/libobs/util/threading-posix.c index 720cfbc07..a36010093 100644 --- a/libobs/util/threading-posix.c +++ b/libobs/util/threading-posix.c @@ -26,6 +26,10 @@ #include #endif +#if defined(__FreeBSD__) +#include +#endif + #include "bmem.h" #include "threading.h" @@ -256,6 +260,8 @@ void os_set_thread_name(const char *name) { #if defined(__APPLE__) pthread_setname_np(name); +#elif defined(__FreeBSD__) + pthread_set_name_np(pthread_self(), name); #elif !defined(__MINGW32__) pthread_setname_np(pthread_self(), name); #endif