summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbuspendingcall_p.h
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-06-10 04:37:54 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-06-10 04:37:54 (GMT)
commitb2cfa7ceaba6f6aef3f9d01f82f8aba95ba45cd6 (patch)
treec84ba40e7e2b5505d4c46a1f144529b0d05f9769 /src/dbus/qdbuspendingcall_p.h
parenta4df1784086ee086e64b35fc1d2df827704708be (diff)
parentbe68f6960f7665c715ea4cca90c2ea4ccae1e0fa (diff)
downloadQt-b2cfa7ceaba6f6aef3f9d01f82f8aba95ba45cd6.zip
Qt-b2cfa7ceaba6f6aef3f9d01f82f8aba95ba45cd6.tar.gz
Qt-b2cfa7ceaba6f6aef3f9d01f82f8aba95ba45cd6.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.6
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 641c397..c3aed53 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"
@@ -71,24 +73,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);