Port to QRecursiveMutex

Recursive and non-recursive mutexes are distinct types in Qt6.
This commit is contained in:
Volker Krause 2022-03-09 17:42:42 +01:00
parent ce22e95d89
commit fe56f36dd0
4 changed files with 5 additions and 6 deletions

View file

@ -126,7 +126,6 @@ Connection::Connection(Context *input, QObject *parent)
: QObject(parent)
, m_input(input)
, m_notifier(nullptr)
, m_mutex(QMutex::Recursive)
{
Q_ASSERT(m_input);
// need to connect to KGlobalSettings as the mouse KCM does not emit a dedicated signal

View file

@ -16,7 +16,7 @@
#include <QObject>
#include <QPointer>
#include <QSize>
#include <QMutex>
#include <QRecursiveMutex>
#include <QVector>
#include <QStringList>
@ -67,7 +67,7 @@ private:
void applyScreenToDevice(Device *device);
Context *m_input;
QSocketNotifier *m_notifier;
QMutex m_mutex;
QRecursiveMutex m_mutex;
QVector<Event*> m_eventQueue;
QVector<Device*> m_devices;
KSharedConfigPtr m_config;

View file

@ -626,7 +626,7 @@ KWin::Scripting *KWin::Scripting::create(QObject *parent)
KWin::Scripting::Scripting(QObject *parent)
: QObject(parent)
, m_scriptsLock(new QMutex(QMutex::Recursive))
, m_scriptsLock(new QRecursiveMutex)
, m_qmlEngine(new QQmlEngine(this))
, m_declarativeScriptSharedContext(new QQmlContext(m_qmlEngine, this))
, m_workspaceWrapper(new QtScriptWorkspaceWrapper(this))

View file

@ -28,7 +28,7 @@ class QQmlContext;
class QQmlEngine;
class QAction;
class QMenu;
class QMutex;
class QRecursiveMutex;
class QQuickWindow;
class KConfigGroup;
@ -315,7 +315,7 @@ private:
/**
* Lock to protect the scripts member variable.
*/
QScopedPointer<QMutex> m_scriptsLock;
QScopedPointer<QRecursiveMutex> m_scriptsLock;
// Preferably call ONLY at load time
void runScripts();