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.
This commit is contained in:
Kris Moore
2015-05-01 22:05:00 +02:00
committed by fryshorts
parent 013e97ff54
commit 5803d921ae

View File

@@ -26,6 +26,10 @@
#include <semaphore.h>
#endif
#if defined(__FreeBSD__)
#include <pthread_np.h>
#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