effectively revert f94e9391f2

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-03-23 19:41:16 +02:00
parent c9157d383f
commit 63bc15f0f9

View file

@ -49,6 +49,19 @@
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;
};
bool QCoreApplicationPrivate::checkInstance(const char *function)
{
if (Q_UNLIKELY(!QCoreApplication::self)) {
@ -818,7 +831,7 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
}
// lock the post event mutex
QMutexLocker locker(&data->postEventList.mutex);
data->postEventList.mutex.lock();
// if object has moved to another thread, follow it
while (data != *pdata) {
@ -834,6 +847,8 @@ void QCoreApplication::postEvent(QObject *receiver, QEvent *event, int priority)
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)) {