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>
This commit is contained in:
Janne Koskinen 2019-06-03 15:29:23 +03:00
parent 91d2905f43
commit 6792c42f1e

View File

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