void-packages/srcpkgs/qt5/patches/qt-musl-set_thread_name_np....

25 lines
769 B
Diff
Raw Normal View History

--- qtlocation/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp 2017-11-14 18:03:52.000000000 +0100
+++ 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() {