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>
This commit is contained in:
parent
a63ca3fa10
commit
29efec2d8c
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user