QDBusIntegrator: fix unprotected QDBusPendingCallPrivate::waitingForFinished call
authorMarc Mutz <marc.mutz@kdab.com>
Wed, 29 Aug 2012 16:12:28 +0000 (18:12 +0200)
committerQt by Nokia <qt-info@nokia.com>
Fri, 7 Sep 2012 23:44:13 +0000 (01:44 +0200)
commit194e0bd7e47a9e7a73597c218ffc3f04a50e8e48
tree4af75ba4081a6431a8e935776d930b69222ac509
parent4f4fc20d2d0188978c43e105ed60d71ba2396fd4
QDBusIntegrator: fix unprotected QDBusPendingCallPrivate::waitingForFinished call

There probably is a happens-before relation to all the writes of the bool elsewhere,
but the comment in QDBusPendingCallPrivate says waitingForFinsihed is one of the
variables protected by the mutex, so don't make every reader of the code re-establish
the safety (if indeed, it is safe) oneself again, but just wrap the access in a
mutex lock.

To be able to compile the mutex locking out of release builds, wrap the access
in a function. Make the function static _inline_ so compilers won't complain
about it being unused in release builds.

Change-Id: I914ce91e64e776450c697a3243b35716390a218c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/dbus/qdbusintegrator.cpp