QT_BEGIN_NAMESPACE
-class QMutexUnlocker
-{
-public:
- inline explicit QMutexUnlocker(QMutex *m)
- : mtx(m)
- { }
- inline ~QMutexUnlocker() { unlock(); }
- inline void unlock() { if (mtx) mtx->unlock(); mtx = 0; }
-
-private:
- Q_DISABLE_COPY(QMutexUnlocker)
-
- QMutex *mtx;
-};
-
QString QCoreApplicationPrivate::appName() const
{
QMutexLocker locker(QMutexPool::globalInstanceGet(&applicationName));
}
// lock the post event mutex
- data->postEventList.mutex.lock();
+ QMutexLocker locker(&data->postEventList.mutex);
// if object has moved to another thread, follow it
while (data != *pdata) {
data->postEventList.mutex.lock();
}
- QMutexUnlocker locker(&data->postEventList.mutex);
-
// if this is one of the compressible events, do compression
if (receiver->d_func()->postedEvents
&& self && self->compressEvent(event, receiver, &data->postEventList)) {