summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorJanne Koskinen <janne.p.koskinen@qt.io>2019-06-03 15:29:23 +0300
committerJanne Koskinen <janne.p.koskinen@qt.io>2019-06-03 15:29:23 +0300
commit6792c42f1ec0dc44617c74e1b1a69c0b200ded07 (patch)
tree58f97071dd5966e19dd292a1401a09527f07ca81 /src/corelib
parent91d2905f438072ac63bbc01000369aa0b5795cc8 (diff)
Add names for pthreads in Integrity
Set name for pthread instead of "name too long" for easier tracking. Change-Id: Iab22cbeac01277e4dc1325399c7892de2e5bd551 Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qthread_unix.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 329caa02ba..695d45d8e7 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -720,6 +720,12 @@ void QThread::start(Priority priority)
}
}
+#ifdef Q_OS_INTEGRITY
+ if (Q_LIKELY(objectName().isEmpty()))
+ pthread_attr_setthreadname(&attr, metaObject()->className());
+ else
+ pthread_attr_setthreadname(&attr, objectName().toLocal8Bit());
+#endif
pthread_t threadId;
int code = pthread_create(&threadId, &attr, QThreadPrivate::start, this);
if (code == EPERM) {