diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-08-06 16:10:33 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-18 08:34:53 +0200 |
commit | 8ab56793276eef297483fa203bb6fe40dc20c76d (patch) | |
tree | 1488180e7d2bb33152f6dd2bb313c222181e98a0 /src/corelib | |
parent | 2ef3ac72fc068b825f2185ab3682219dc7246464 (diff) |
Mark simple static methods in QThread as Q_DECL_NOTHROW
These methods aren't often used, but currentThreadId() gets used in the
recursive mutex code to store the identity of the thread with multiple
locks.
Change-Id: I031cf3893aa6e7fd7a53733fc1088d295bdb9079
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/thread/qthread.h | 4 | ||||
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 4 | ||||
-rw-r--r-- | src/corelib/thread/qthread_win.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h index 953632c6fc..978dbe8b19 100644 --- a/src/corelib/thread/qthread.h +++ b/src/corelib/thread/qthread.h @@ -59,9 +59,9 @@ class QAbstractEventDispatcher; class Q_CORE_EXPORT QThread : public QObject { public: - static Qt::HANDLE currentThreadId(); + static Qt::HANDLE currentThreadId() Q_DECL_NOTHROW; static QThread *currentThread(); - static int idealThreadCount(); + static int idealThreadCount() Q_DECL_NOTHROW; static void yieldCurrentThread(); explicit QThread(QObject *parent = 0); diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index d047cc8606..f472dee56e 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -381,7 +381,7 @@ void QThreadPrivate::finish(void *arg) ** QThread *************************************************************************/ -Qt::HANDLE QThread::currentThreadId() +Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW { // requires a C cast here otherwise we run into trouble on AIX return (Qt::HANDLE)pthread_self(); @@ -392,7 +392,7 @@ Qt::HANDLE QThread::currentThreadId() # define _SC_NPROCESSORS_ONLN 84 #endif -int QThread::idealThreadCount() +int QThread::idealThreadCount() Q_DECL_NOTHROW { int cores = -1; diff --git a/src/corelib/thread/qthread_win.cpp b/src/corelib/thread/qthread_win.cpp index e443166c9a..fb9ebf20b8 100644 --- a/src/corelib/thread/qthread_win.cpp +++ b/src/corelib/thread/qthread_win.cpp @@ -390,12 +390,12 @@ void QThreadPrivate::finish(void *arg, bool lockAnyway) ** QThread *************************************************************************/ -Qt::HANDLE QThread::currentThreadId() +Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW { return (Qt::HANDLE)GetCurrentThreadId(); } -int QThread::idealThreadCount() +int QThread::idealThreadCount() Q_DECL_NOTHROW { SYSTEM_INFO sysinfo; GetSystemInfo(&sysinfo); |