From 0d1ded5278fdee30da1055b75f1d6e4dbab9963e Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 23 Jun 2013 07:39:38 -0700 Subject: [PATCH] Avoid using pthread_setname_np on older linux distros --- modules/beast_core/native/beast_posix_SharedCode.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/beast_core/native/beast_posix_SharedCode.h b/modules/beast_core/native/beast_posix_SharedCode.h index 1903180f7..41051e2bf 100644 --- a/modules/beast_core/native/beast_posix_SharedCode.h +++ b/modules/beast_core/native/beast_posix_SharedCode.h @@ -870,7 +870,7 @@ void Thread::setCurrentThreadName (const String& name) { [[NSThread currentThread] setName: beastStringToNS (name)]; } - #elif BEAST_LINUX + #elif BEAST_LINUX && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 pthread_setname_np (pthread_self(), name.toRawUTF8()); #endif } @@ -881,7 +881,7 @@ bool Thread::setThreadPriority (void* handle, int priority) int policy; priority = blimit (0, 10, priority); - if (handle == 0) + if (handle == nullptr) handle = (void*) pthread_self(); if (pthread_getschedparam ((pthread_t) handle, &policy, ¶m) != 0)