summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread/qthread_unix.cpp')
-rw-r--r--src/corelib/thread/qthread_unix.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 21ed8131df..a47115cfac 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -44,11 +44,15 @@
#include "qplatformdefs.h"
#include <private/qcoreapplication_p.h>
-#if !defined(QT_NO_GLIB)
-# include "../kernel/qeventdispatcher_glib_p.h"
-#endif
-#include <private/qeventdispatcher_unix_p.h>
+#if defined(Q_OS_BLACKBERRY)
+# include <private/qeventdispatcher_blackberry_p.h>
+#else
+# if !defined(QT_NO_GLIB)
+# include "../kernel/qeventdispatcher_glib_p.h"
+# endif
+# include <private/qeventdispatcher_unix_p.h>
+#endif
#include "qthreadstorage.h"
@@ -79,9 +83,9 @@
# define old_qDebug qDebug
# undef qDebug
# endif
-#ifndef QT_NO_CORESERVICES
+#ifndef Q_OS_IOS
# include <CoreServices/CoreServices.h>
-#endif //QT_NO_CORESERVICES
+#endif //Q_OS_IOS
# ifdef old_qDebug
# undef qDebug
@@ -248,6 +252,9 @@ typedef void*(*QtThreadCallback)(void*);
void QThreadPrivate::createEventDispatcher(QThreadData *data)
{
+#if defined(Q_OS_BLACKBERRY)
+ data->eventDispatcher = new QEventDispatcherBlackberry;
+#else
#if !defined(QT_NO_GLIB)
if (qgetenv("QT_NO_GLIB").isEmpty()
&& qgetenv("QT_NO_THREADED_GLIB").isEmpty()
@@ -256,6 +263,8 @@ void QThreadPrivate::createEventDispatcher(QThreadData *data)
else
#endif
data->eventDispatcher = new QEventDispatcherUNIX;
+#endif
+
data->eventDispatcher->startingUp();
}
@@ -288,7 +297,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 +308,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
@@ -371,7 +382,7 @@ int QThread::idealThreadCount()
{
int cores = -1;
-#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
+#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
// Mac OS X
cores = MPProcessorsScheduled();
#elif defined(Q_OS_HPUX)