Skip to content

Commit

Permalink
Add names for pthreads in Integrity
Browse files Browse the repository at this point in the history
Set name for pthread instead of "name too long" for easier tracking.

Change-Id: Iab22cbeac01277e4dc1325399c7892de2e5bd551
Reviewed-by: Timo Aarnipuro <[email protected]>
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
Janne Koskinen committed Jun 3, 2019
1 parent 91d2905 commit 6792c42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/corelib/thread/qthread_unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6792c42

Please sign in to comment.