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>
This commit is contained in:
Thiago Macieira 2012-08-06 16:10:33 +02:00 committed by Qt by Nokia
parent 2ef3ac72fc
commit 8ab5679327
3 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);