diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-03-28 16:54:06 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-03-31 14:32:42 (GMT) |
commit | df9491b302f6404ad2ccc6dc2eb3377176d994c6 (patch) | |
tree | ea041707bfae4eb5586b3b67c7f24b9a262e09c0 /src/corelib/kernel | |
parent | 3ae213cdeffae107ffa5a4b552c6351123dcc5cb (diff) | |
download | Qt-df9491b302f6404ad2ccc6dc2eb3377176d994c6.zip Qt-df9491b302f6404ad2ccc6dc2eb3377176d994c6.tar.gz Qt-df9491b302f6404ad2ccc6dc2eb3377176d994c6.tar.bz2 |
Optimize QMetaObject::activate (remove call to QThreadData::current)
QThreadData::current is too slow, it needs to access the TLS
The currentThreadId is much faster.
Reviewed-by: Brad
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index c6153cb..7ad9f9b 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -3478,7 +3478,7 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign argv ? argv : empty_argv); } - QThreadData *currentThreadData = QThreadData::current(); + Qt::HANDLE currentThreadId = QThread::currentThreadId(); QMutexLocker locker(signalSlotLock(sender)); QObjectConnectionListVector *connectionLists = sender->d_func()->connectionLists; @@ -3506,7 +3506,7 @@ void QMetaObject::activate(QObject *sender, const QMetaObject *m, int local_sign QObject * const receiver = c->receiver; const int method = c->method; - const bool receiverInSameThread = currentThreadData == receiver->d_func()->threadData; + const bool receiverInSameThread = currentThreadId == receiver->d_func()->threadData->threadId; // determine if this connection should be sent immediately or // put into the event queue |