From 6792c42f1ec0dc44617c74e1b1a69c0b200ded07 Mon Sep 17 00:00:00 2001 From: Janne Koskinen Date: Mon, 3 Jun 2019 15:29:23 +0300 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_unix.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/corelib') 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) { -- cgit v1.2.3