Use real pthread_setname_np implementation on old FreeBSD.

pthread_setname_np differs from pthread_set_name_np in the return value, so
it is not correct to just #define one to another.
This commit is contained in:
Gleb Popov 2021-07-01 15:48:01 +03:00 committed by Wim Taymans
parent 797e9b3e0b
commit 43e4625bbe

View file

@ -37,8 +37,14 @@
#define pw_thread_loop_events_destroy(o) pw_thread_loop_events_emit(o, destroy, 0) #define pw_thread_loop_events_destroy(o) pw_thread_loop_events_emit(o, destroy, 0)
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#include <pthread_np.h> #include <sys/param.h>
#define pthread_setname_np pthread_set_name_np #if __FreeBSD_version < 1202000
int pthread_setname_np(pthread_t thread, const char *name)
{
pthread_set_name_np(thread, name);
return 0;
}
#endif
#endif #endif
/** \cond */ /** \cond */