ref: 5d6b20119a82ae4ca52c314a4348f1ee77f9657f
parent: a594ddf3e7ce8efa598df858129469024eb1a153
parent: 0a3d4c4ebc50e63ef8fbb9a5b634c1f7db00400c
author: sijchen <sijchen@cisco.com>
date: Fri Oct 24 05:00:09 EDT 2014
Merge pull request #1442 from mstorsjo/android-pthread-setname Only use pthread_setname_np on Android >= 9 (2.3)
--- a/codec/common/src/WelsThreadLib.cpp
+++ b/codec/common/src/WelsThreadLib.cpp
@@ -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 @@
#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