diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2013-11-21 10:08:45 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-12-04 17:17:41 +0100 |
commit | de816219eebf0b42df4bcd9089ae4691e9ca3095 (patch) | |
tree | 20332db566996e79e05631a5b1e272b3eadd4765 | |
parent | 7529d38d836d0d781c2a813d0a973b3ee152611d (diff) |
Document that disconnectNotify may be called with a mutex locked
And that connectNotify and disconnectNotify might be called from
another thread
Task-number: QTBUG-34829
Change-Id: Id118b97b92e9aa085a1d4368282294f90cfb1706
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
-rw-r--r-- | src/corelib/kernel/qobject.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index f8664ba3a2..3fbeaa8712 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -2996,6 +2996,10 @@ bool QObject::disconnect(const QObject *sender, const QMetaMethod &signal, expensive initialization only if something is connected to a signal. + \warning This function is called from the thread which performs the + connection, which may be a different thread from the thread in + which this object lives. + \sa connect(), disconnectNotify() */ @@ -3022,6 +3026,15 @@ void QObject::connectNotify(const QMetaMethod &signal) modularity. However, it might be useful for optimizing access to expensive resources. + \warning This function is called from the thread which performs the + disconnection, which may be a different thread from the thread in + which this object lives. This function may also be called with a QObject + internal mutex locked. It is therefore not allowed to re-enter any + of any QObject functions from your reimplementation and if you lock + a mutex in your reimplementation, make sure that you don't call QObject + functions with that mutex held in other places or it will result in + a deadlock. + \sa disconnect(), connectNotify() */ |