Krita Source Code Documentation
Loading...
Searching...
No Matches
KisUpgradeToWriteLocker.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2017 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KISUPGRADETOWRITELOCKER_H
8#define KISUPGRADETOWRITELOCKER_H
9
10#include <QReadLocker>
11#include <QReadWriteLock>
12
23{
24public:
25 KisUpgradeToWriteLocker(QReadLocker *locker)
26 : m_locker(locker)
27 {
28 m_locker->unlock();
29 m_locker->readWriteLock()->lockForWrite();
30 }
31
33 m_locker->readWriteLock()->unlock();
34 m_locker->relock();
35 }
36
37private:
38 QReadLocker *m_locker;
39};
40
41
42
43#endif // KISUPGRADETOWRITELOCKER_H
The KisUpgradeToWriteLocker class is use for RAII style unlocking the read lock and then locking the ...
KisUpgradeToWriteLocker(QReadLocker *locker)