plasma: replace QReadWriteLock with QMutex

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-05-16 12:04:35 +03:00
parent 78802289b0
commit 025826275d

View file

@ -21,8 +21,7 @@
#include <cmath> #include <cmath>
#include <QReadWriteLock> #include <QMutex>
#include <QDir> #include <QDir>
#include <QFile> #include <QFile>
#include <QFileInfo> #include <QFileInfo>
@ -40,12 +39,8 @@
#include "abstractrunner.h" #include "abstractrunner.h"
#include "querymatch.h" #include "querymatch.h"
//#define LOCK_FOR_READ(d) if (d->policy == Shared) { d->lock.lockForRead(); } #define LOCK_FOR_READ(d) d->lock.lock();
//#define LOCK_FOR_WRITE(d) if (d->policy == Shared) { d->lock.lockForWrite(); } #define LOCK_FOR_WRITE(d) d->lock.lock();
//#define UNLOCK(d) if (d->policy == Shared) { d->lock.unlock(); }
#define LOCK_FOR_READ(d) d->lock.lockForRead();
#define LOCK_FOR_WRITE(d) d->lock.lockForWrite();
#define UNLOCK(d) d->lock.unlock(); #define UNLOCK(d) d->lock.unlock();
namespace Plasma namespace Plasma
@ -249,7 +244,7 @@ class RunnerContextPrivate : public QSharedData
q = &s_dummyContext; q = &s_dummyContext;
} }
QReadWriteLock lock; QMutex lock;
QList<QueryMatch> matches; QList<QueryMatch> matches;
QMap<QString, const QueryMatch*> matchesById; QMap<QString, const QueryMatch*> matchesById;
QHash<QString, int> launchCounts; QHash<QString, int> launchCounts;