summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer.qnx@kdab.com>2012-08-16 09:22:46 +0100
committerQt by Nokia <qt-info@nokia.com>2012-08-17 12:23:56 +0200
commit47fd7128dba4c38ff1bfcc517fec0f063fb90e4c (patch)
tree2a169fbd02922022e762b2e61b3df5a6c9463939
parentc7b6a666a8b91144211fa4f160908c3f0be8e17e (diff)
Fix compilation of QThread on QNX
Commit 3ef51efbe75bfb9f1dfbe7df073e9eb745a72ad8 broke compilation of qthread_unix.cpp on QNX. This fixes it by passing in the threadId to setCurrentThreadName(). Change-Id: I24f32d8054baedbd9a65b6a80fb1f6f37e07092d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
-rw-r--r--src/corelib/thread/qthread_unix.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 47d6f48ed9..d047cc8606 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -271,14 +271,16 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
#ifndef QT_NO_THREAD
#if (defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_QNX))
-static void setCurrentThreadName(const char *name)
+static void setCurrentThreadName(pthread_t threadId, const char *name)
{
# if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE)
+ Q_UNUSED(threadId);
prctl(PR_SET_NAME, (unsigned long)name, 0, 0, 0);
# elif defined(Q_OS_MAC)
+ Q_UNUSED(threadId);
pthread_setname_np(name);
# elif defined(Q_OS_QNX)
- pthread_setname_np(thr->d_func()->thread_id, name);
+ pthread_setname_np(threadId, name);
# endif
}
#endif
@@ -317,9 +319,9 @@ void *QThreadPrivate::start(void *arg)
QString objectName = thr->objectName();
if (Q_LIKELY(objectName.isEmpty()))
- setCurrentThreadName(thr->metaObject()->className());
+ setCurrentThreadName(thr->d_func()->thread_id, thr->metaObject()->className());
else
- setCurrentThreadName(objectName.toLocal8Bit());
+ setCurrentThreadName(thr->d_func()->thread_id, objectName.toLocal8Bit());
#endif