void-packages/srcpkgs/qt5/patches/0014-musl-set_thread_name_n...

25 lines
769 B
Diff

--- 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() {