Only use pthread_setname_np on Android >= 9 (2.3)
Older versions of Android don't have this function.
This commit is contained in:
@@ -58,6 +58,9 @@
|
|||||||
#ifdef ANDROID_NDK
|
#ifdef ANDROID_NDK
|
||||||
#include <cpu-features.h>
|
#include <cpu-features.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
#include <android/api-level.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "WelsThreadLib.h"
|
#include "WelsThreadLib.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -252,7 +255,7 @@ WELS_THREAD_ERROR_CODE WelsThreadSetName (const char* thread_name) {
|
|||||||
#ifdef APPLE_IOS
|
#ifdef APPLE_IOS
|
||||||
pthread_setname_np(thread_name);
|
pthread_setname_np(thread_name);
|
||||||
#endif
|
#endif
|
||||||
#ifdef __ANDROID__
|
#if defined(__ANDROID__) && __ANDROID_API__ >= 9
|
||||||
pthread_setname_np(pthread_self(), thread_name);
|
pthread_setname_np(pthread_self(), thread_name);
|
||||||
#endif
|
#endif
|
||||||
// do nothing
|
// do nothing
|
||||||
|
|||||||
Reference in New Issue
Block a user