Merge pull request #1442 from mstorsjo/android-pthread-setname

Only use pthread_setname_np on Android >= 9 (2.3)
This commit is contained in:
sijchen 2014-10-24 09:00:09 +08:00
commit 5d6b20119a

View File

@ -58,6 +58,9 @@
#ifdef ANDROID_NDK
#include <cpu-features.h>
#endif
#ifdef __ANDROID__
#include <android/api-level.h>
#endif
#include "WelsThreadLib.h"
#include <stdio.h>
@ -252,7 +255,7 @@ WELS_THREAD_ERROR_CODE WelsThreadSetName (const char* thread_name) {
#ifdef APPLE_IOS
pthread_setname_np(thread_name);
#endif
#ifdef __ANDROID__
#if defined(__ANDROID__) && __ANDROID_API__ >= 9
pthread_setname_np(pthread_self(), thread_name);
#endif
// do nothing