25 lines
773 B
Diff
25 lines
773 B
Diff
--- a/qtlocation/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp 2017-11-14 18:03:52.000000000 +0100
|
|
+++ b/qtlocation/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp 2018-01-27 19:49:19.691858141 +0100
|
|
@@ -11,17 +11,21 @@
|
|
|
|
std::string getCurrentThreadName() {
|
|
char name[32] = "unknown";
|
|
+#if defined(__GLIBC__)
|
|
pthread_getname_np(pthread_self(), name, sizeof(name));
|
|
+#endif
|
|
|
|
return name;
|
|
}
|
|
|
|
void setCurrentThreadName(const std::string& name) {
|
|
+#if defined(__GLIBC__)
|
|
if (name.size() > 15) { // Linux hard limit (see manpages).
|
|
pthread_setname_np(pthread_self(), name.substr(0, 15).c_str());
|
|
} else {
|
|
pthread_setname_np(pthread_self(), name.c_str());
|
|
}
|
|
+#endif
|
|
}
|
|
|
|
void makeThreadLowPriority() {
|