summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-11-25 13:32:37 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-11-25 13:32:37 (GMT)
commit850ebb63dfe5fbfdb2107d33a1af4460da59b97c (patch)
tree5e0350e3180de97b561be16072ff1444499048d3 /src/corelib/thread
parente868e896054061f35b38dd3e7b688d932be40a55 (diff)
parent5200f708c46d4bc737d6706691965c726c063292 (diff)
downloadQt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.zip
Qt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.tar.gz
Qt-850ebb63dfe5fbfdb2107d33a1af4460da59b97c.tar.bz2
Merge remote branch 'origin/4.7' into qt-master-from-4.7
Conflicts: qmake/generators/symbian/symmake.cpp src/corelib/global/qglobal.h src/gui/kernel/qwidget_p.h src/gui/painting/qtextureglyphcache.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h src/plugins/qpluginbase.pri src/qbase.pri tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp tests/auto/qthread/tst_qthread.cpp tests/auto/selftests/expected_cmptest.txt tests/auto/selftests/expected_crashes_3.txt tests/auto/selftests/expected_longstring.txt tests/auto/selftests/expected_maxwarnings.txt tests/auto/selftests/expected_skip.txt tools/assistant/tools/assistant/doc/assistant.qdocconf tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qdeclarative.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt-build-docs_ja_JP.qdocconf tools/qdoc3/test/qt-build-docs_zh_CN.qdocconf tools/qdoc3/test/qt.qdocconf tools/qdoc3/test/qt_ja_JP.qdocconf tools/qdoc3/test/qt_zh_CN.qdocconf
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qthread.cpp4
-rw-r--r--src/corelib/thread/qthread_unix.cpp13
2 files changed, 12 insertions, 5 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 71a4896..c9ff8d3 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -488,8 +488,10 @@ int QThread::exec()
Q_D(QThread);
QMutexLocker locker(&d->mutex);
d->data->quitNow = false;
- if (d->exited)
+ if (d->exited) {
+ d->exited = false;
return d->returnCode;
+ }
locker.unlock();
QEventLoop eventLoop;
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index b674ab8..0892d8e 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -99,6 +99,11 @@
# define SCHED_IDLE 5
#endif
+#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#define QT_HAS_THREAD_PRIORITY_SCHEDULING
+#endif
+
+
QT_BEGIN_NAMESPACE
#ifndef QT_NO_THREAD
@@ -512,10 +517,10 @@ void QThread::usleep(unsigned long usecs)
thread_sleep(&ti);
}
+#ifdef QT_HAS_THREAD_PRIORITY_SCHEDULING
// Does some magic and calculate the Unix scheduler priorities
// sched_policy is IN/OUT: it must be set to a valid policy before calling this function
// sched_priority is OUT only
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
static bool calculateUnixPriority(int priority, int *sched_policy, int *sched_priority)
{
#ifdef SCHED_IDLE
@@ -568,7 +573,7 @@ void QThread::start(Priority priority)
d->priority = priority;
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && !defined(Q_OS_SYMBIAN) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#if defined(QT_HAS_THREAD_PRIORITY_SCHEDULING) && !defined(Q_OS_SYMBIAN)
// ### Need to implement thread sheduling and priorities for symbian os. Implementation removed for now
switch (priority) {
case InheritPriority:
@@ -609,7 +614,7 @@ void QThread::start(Priority priority)
break;
}
}
-#endif // _POSIX_THREAD_PRIORITY_SCHEDULING
+#endif // QT_HAS_THREAD_PRIORITY_SCHEDULING
#ifdef Q_OS_SYMBIAN
if (d->stackSize == 0)
@@ -772,7 +777,7 @@ void QThread::setPriority(Priority priority)
// copied from start() with a few modifications:
-#if defined(Q_OS_DARWIN) || !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
+#ifdef QT_HAS_THREAD_PRIORITY_SCHEDULING
int sched_policy;
sched_param param;