diff -r e24348a560a6 -r b72c6db6890b src/dbus/qdbuspendingcall_p.h --- a/src/dbus/qdbuspendingcall_p.h Fri Jun 11 14:24:45 2010 +0300 +++ b/src/dbus/qdbuspendingcall_p.h Wed Jun 23 19:07:03 2010 +0300 @@ -57,6 +57,8 @@ #include #include #include +#include +#include #include "qdbusmessage.h" #include "qdbus_symbols_p.h" @@ -71,24 +73,35 @@ 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 receiver; QList metaTypes; int methodIdx; bool autoDelete; + // } - QDBusPendingCallPrivate() : watcherHelper(0), pending(0), autoDelete(false) + mutable QMutex mutex; + QWaitCondition waitForFinishedCondition; + + // { + // protected by the mutex above: + QDBusPendingCallWatcherHelper *watcherHelper; + QDBusMessage replyMessage; + DBusPendingCall *pending; + volatile bool waitingForFinished; + + QString expectedReplySignature; + int expectedReplyCount; + // } + + 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);