Set thread name on QNX
Change-Id: I4fc786afce2e53676b148332dddd2c84228f7d87 Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
a5565bcac0
commit
fe7c600fab
@ -288,7 +288,7 @@ void *QThreadPrivate::start(void *arg)
|
|||||||
else
|
else
|
||||||
createEventDispatcher(data);
|
createEventDispatcher(data);
|
||||||
|
|
||||||
#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC))
|
#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX))
|
||||||
// sets the name of the current thread.
|
// sets the name of the current thread.
|
||||||
QByteArray objectName = thr->objectName().toLocal8Bit();
|
QByteArray objectName = thr->objectName().toLocal8Bit();
|
||||||
|
|
||||||
@ -299,6 +299,8 @@ void *QThreadPrivate::start(void *arg)
|
|||||||
prctl(PR_SET_NAME, (unsigned long)objectName.constData(), 0, 0, 0);
|
prctl(PR_SET_NAME, (unsigned long)objectName.constData(), 0, 0, 0);
|
||||||
#elif defined(Q_OS_MAC)
|
#elif defined(Q_OS_MAC)
|
||||||
pthread_setname_np(objectName.constData());
|
pthread_setname_np(objectName.constData());
|
||||||
|
#elif defined(Q_OS_QNX)
|
||||||
|
pthread_setname_np(thr->d_func()->thread_id, objectName.constData());
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user