summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2012-04-23 10:55:18 +0100
committerQt by Nokia <qt-info@nokia.com>2012-04-23 19:20:19 +0200
commitfe7c600fabdfb1b4cbad624ce7cb736e5edce86d (patch)
tree2518f66e1dab8088bd224efc888f46b4591f594a /src/corelib
parenta5565bcac0e19ba4cd2cb076c45bc82af4b33285 (diff)
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>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qthread_unix.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 41a27c7503..3af54c7fc7 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -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