summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbuspendingcall_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-05-25 10:23:01 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2010-05-25 10:23:01 +0200
commit7c471bde498c07f03acc612d5f132b904bc3870e (patch)
tree136805e93f9b781c6900f5efaa0bd6ce2301b68d /src/dbus/qdbuspendingcall_p.h
parent55664a0ef4b88b67c9931c7d2f6853e5fa0a9716 (diff)
parent6f6909ac6681ed614f00998a0d43b7b195dbb90b (diff)
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: demos/spectrum/app/app.pro src/gui/egl/qegl.cpp tests/auto/qhttpnetworkconnection/qhttpnetworkconnection.pro tests/auto/qmenu/tst_qmenu.cpp
Diffstat (limited to 'src/dbus/qdbuspendingcall_p.h')
-rw-r--r--src/dbus/qdbuspendingcall_p.h35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/dbus/qdbuspendingcall_p.h b/src/dbus/qdbuspendingcall_p.h
index f1f6dc24ec..8683552fa6 100644
--- a/src/dbus/qdbuspendingcall_p.h
+++ b/src/dbus/qdbuspendingcall_p.h
@@ -57,6 +57,8 @@
#include <qshareddata.h>
#include <qpointer.h>
#include <qlist.h>
+#include <qmutex.h>
+#include <qwaitcondition.h>
#include "qdbusmessage.h"
#include "qdbus_symbols_p.h"
@@ -73,24 +75,35 @@ class QDBusConnectionPrivate;
class QDBusPendingCallPrivate: public QSharedData
{
public:
- QDBusMessage sentMessage;
- QDBusMessage replyMessage;
-// QDBusMessage pendingReplyMessage; // used in the local loop
- QDBusPendingCallWatcherHelper *watcherHelper;
- DBusPendingCall *pending;
- QDBusConnectionPrivate *connection;
+ // {
+ // set only during construction:
+ const QDBusMessage sentMessage;
+ QDBusConnectionPrivate * const connection;
- QString expectedReplySignature;
- int expectedReplyCount;
-
- // for the callback
+ // for the callback mechanism (see setReplyCallback and QDBusConnectionPrivate::sendWithReplyAsync)
QPointer<QObject> receiver;
QList<int> metaTypes;
int methodIdx;
bool autoDelete;
+ // }
+
+ mutable QMutex mutex;
+ QWaitCondition waitForFinishedCondition;
+
+ // {
+ // protected by the mutex above:
+ QDBusPendingCallWatcherHelper *watcherHelper;
+ QDBusMessage replyMessage;
+ DBusPendingCall *pending;
+ volatile bool waitingForFinished;
+
+ QString expectedReplySignature;
+ int expectedReplyCount;
+ // }
- QDBusPendingCallPrivate() : watcherHelper(0), pending(0), autoDelete(false)
+ QDBusPendingCallPrivate(const QDBusMessage &sent, QDBusConnectionPrivate *connection)
+ : sentMessage(sent), connection(connection), autoDelete(false), watcherHelper(0), pending(0), waitingForFinished(false)
{ }
~QDBusPendingCallPrivate();
bool setReplyCallback(QObject *target, const char *member);