build: restore BSD thread names after 9f461b85bf
On FreeBSD non-POSIX threading functions are in a separate header.
DragonFly and OpenBSD adopted FreeBSD header and extensions.
../test.c:3:3: error: implicit declaration of function 'pthread_set_name_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
{ pthread_set_name_np(pthread_self(), "ducks"); return 0; }
^
../osdep/threads.c:47:5: error: implicit declaration of function 'pthread_set_name_np' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pthread_set_name_np(pthread_self(), tname);
^
Signed-off-by: Jan Beich <[email protected]>
This commit is contained in:
1 parent
ca83080fff
commit
9cbacefbb0
2 files changed
+5
-1
No files matched your search
@@ -24,6 +24,10 @@
|
||||
#include "threads.h"
|
||||
#include "timer.h"
|
||||
|
||||
#if HAVE_BSD_THREAD_NAME
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
int mpthread_mutex_init_recursive(pthread_mutex_t *mutex)
|
||||
{
|
||||
pthread_mutexattr_t attr;
|
||||
|
||||
@@ -308,7 +308,7 @@ iconv support use --disable-iconv.",
|
||||
'name': 'bsd-thread-name',
|
||||
'desc': 'BSD API for setting thread name',
|
||||
'deps': '!(glibc-thread-name || osx-thread-name)',
|
||||
'func': check_statement('pthread.h',
|
||||
'func': check_statement(['pthread.h', 'pthread_np.h'],
|
||||
'pthread_set_name_np(pthread_self(), "ducks")',
|
||||
use=['pthreads']),
|
||||
}, {
|
||||
|
||||
Reference in new issue
Block a user