diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-04-25 17:55:55 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-05-08 06:51:27 +0000 |
commit | 29efec2d8cc8138f990fedc55a73e48635f999fb (patch) | |
tree | e06024a38c8212609715eefaeab2075fa5c88218 | |
parent | a63ca3fa106f4b0f9776bf2004661ef6dec2c0c6 (diff) |
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) <ogoffart@woboq.com>
-rw-r--r-- | src/corelib/thread/qthread.h | 2 |
1 files changed, 1 insertions, 1 deletions
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(); |