Set thread name on QNX
authorSean Harmer <sean.harmer@kdab.com>
Mon, 23 Apr 2012 09:55:18 +0000 (10:55 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 23 Apr 2012 17:20:19 +0000 (19:20 +0200)
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>
src/corelib/thread/qthread_unix.cpp

index 41a27c7..3af54c7 100644 (file)
@@ -288,7 +288,7 @@ void *QThreadPrivate::start(void *arg)
     else
         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.
     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);
 #elif defined(Q_OS_MAC)
     pthread_setname_np(objectName.constData());
+#elif defined(Q_OS_QNX)
+    pthread_setname_np(thr->d_func()->thread_id, objectName.constData());
 #endif
 #endif