From fe7c600fabdfb1b4cbad624ce7cb736e5edce86d Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Mon, 23 Apr 2012 10:55:18 +0100 Subject: Set thread name on QNX Change-Id: I4fc786afce2e53676b148332dddd2c84228f7d87 Reviewed-by: Kevin Krammer Reviewed-by: Nicolas Arnaud-Cormos Reviewed-by: Thiago Macieira --- src/corelib/thread/qthread_unix.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3