From 29efec2d8cc8138f990fedc55a73e48635f999fb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 25 Apr 2016 17:55:55 -0700 Subject: Mark QThread::currentThreadId() as a pure function It always returns the same information for each thread it is called in. But since it's different per thread, we don't think it's const. pthread_self() on Linux is marked const, though we think it really ought to be pure. On other OSes, the annotation isn't present, but the we can assume function is so. Change-Id: Ifea6e497f11a461db432ffff1448c2b37d94d5f3 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/thread/qthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h index 68ee366277..410f642ca7 100644 --- a/src/corelib/thread/qthread.h +++ b/src/corelib/thread/qthread.h @@ -56,7 +56,7 @@ class Q_CORE_EXPORT QThread : public QObject { Q_OBJECT public: - static Qt::HANDLE currentThreadId() Q_DECL_NOTHROW; + static Qt::HANDLE currentThreadId() Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION; static QThread *currentThread(); static int idealThreadCount() Q_DECL_NOTHROW; static void yieldCurrentThread(); -- cgit v1.2.3