mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
effectively revert f94e9391f2
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
c9157d383f
commit
63bc15f0f9
1 changed files with 16 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue