History

Only use pthread_setname_np on Android >= 9 (2.3)

Older versions of Android don't have this function.

Martin Storsjö committed 12 years ago

Commit 0a3d4c41 parent 94a1d441 file · +4 −1Browse files

Showing the changes to codec/common/src/WelsThreadLib.cpp (1 of 1 file). Show all

Unified · Split

codec/common/src/WelsThreadLib.cpp+4−1
@@ -58,6 +58,9 @@ · 57 unmodified lines
5858 #ifdef ANDROID_NDK
5959 #include <cpu-features.h>
6060 #endif
61+#ifdef __ANDROID__
62+#include <android/api-level.h>
63+#endif
6164
6265 #include "WelsThreadLib.h"
6366 #include <stdio.h>
@@ -252,7 +255,7 @@ WELS_THREAD_ERROR_CODE WelsThreadSetName (const char* thread_name) { · 188 unmodified lines
252255 #ifdef APPLE_IOS
253256 pthread_setname_np(thread_name);
254257 #endif
255−#ifdef __ANDROID__
258+#if defined(__ANDROID__) && __ANDROID_API__ >= 9
256259 pthread_setname_np(pthread_self(), thread_name);
257260 #endif
258261 // do nothing

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t