|
@@ -8,6 +8,11 @@
|
|
|
|
|
|
|
|
#if BX_PLATFORM_POSIX
|
|
#if BX_PLATFORM_POSIX
|
|
|
# include <pthread.h>
|
|
# include <pthread.h>
|
|
|
|
|
+ #if defined(__GLIBC__)
|
|
|
|
|
+ #if!((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12)))
|
|
|
|
|
+ #include <sys/prctl.h>
|
|
|
|
|
+ #endif
|
|
|
|
|
+ #endif
|
|
|
#elif BX_PLATFORM_WINRT
|
|
#elif BX_PLATFORM_WINRT
|
|
|
using namespace Platform;
|
|
using namespace Platform;
|
|
|
using namespace Windows::Foundation;
|
|
using namespace Windows::Foundation;
|
|
@@ -149,7 +154,13 @@ namespace bx
|
|
|
{
|
|
{
|
|
|
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
|
|
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
|
|
|
pthread_setname_np(_name);
|
|
pthread_setname_np(_name);
|
|
|
-#elif (BX_PLATFORM_LINUX && defined(__GLIBC__)) || BX_PLATFORM_BSD
|
|
|
|
|
|
|
+#elif (BX_PLATFORM_LINUX && defined(__GLIBC__))
|
|
|
|
|
+ #if (__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12))
|
|
|
|
|
+ pthread_setname_np(m_handle, _name);
|
|
|
|
|
+ #else
|
|
|
|
|
+ prctl(PR_SET_NAME,_name,0,0,0);
|
|
|
|
|
+ #endif
|
|
|
|
|
+#elif BX_PLATFORM_BSD
|
|
|
pthread_setname_np(m_handle, _name);
|
|
pthread_setname_np(m_handle, _name);
|
|
|
#elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC
|
|
#elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC
|
|
|
# pragma pack(push, 8)
|
|
# pragma pack(push, 8)
|