| 1 | // For license of this file, see <project-root-folder>/LICENSE.md.cxx . . $ `<file>/src/librssguard/miscellaneous/mutex.cpp`/ |
| 2 | |
| 3 | #include "miscellaneous/mutex.h"cxx . . $ `<file>/src/librssguard/miscellaneous/mutex.h`/ |
| 4 | |
| 5 | #include "definitions/definitions.h"cxx . . $ `<file>/src/librssguard/definitions/definitions.h`/ |
| 6 | |
| 7 | Mutexcxx . . $ Mutex#::Mutexcxx . . $ Mutex#Mutex(749de1b6ae65bddd).(QObjectcxx . . $ QObject#* parent) : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent), m_mutexcxx . . $ Mutex#m_mutex.(new QMutexcxx . . $ QMutex#QMutex(49f6e7a06ebc5aa8).()), m_isLockedcxx . . $ Mutex#m_isLocked.(false) {} |
| 8 | |
| 9 | Mutexcxx . . $ Mutex#::~cxx . . $ Mutex#`~Mutex`(ced63f7c635d850d).Mutexcxx . . $ Mutex#() { |
| 10 | qDebugNNcxx . . $ `src/librssguard/definitions/definitions.h:413:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). LOGSEC_COREcxx . . $ `src/librssguard/definitions/definitions.h:178:9`! <<cxx . . $ QDebug#`operator<<`(d8a917b173851aad). ("Destroying Mutex instance."); |
| 11 | } |
| 12 | |
| 13 | void Mutexcxx . . $ Mutex#::lockcxx . . $ Mutex#lock(49f6e7a06ebc5aa8).() { |
| 14 | m_mutexcxx . . $ Mutex#m_mutex.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).lockcxx . . $ QBasicMutex#lock(ced63f7c635d850d).(); |
| 15 | setLockedcxx . . $ Mutex#setLocked(49f6e7a06ebc5aa8).(); |
| 16 | } |
| 17 | |
| 18 | bool Mutexcxx . . $ Mutex#::tryLockcxx . . $ Mutex#tryLock(c9857a73d68e59ba).() { |
| 19 | bool result; |
| 20 | |
| 21 | if ((result = m_mutexcxx . . $ Mutex#m_mutex.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).tryLockcxx . . $ QBasicMutex#tryLock(77ce49a7840d23c7).())) { |
| 22 | setLockedcxx . . $ Mutex#setLocked(49f6e7a06ebc5aa8).(); |
| 23 | } |
| 24 | |
| 25 | return result; |
| 26 | } |
| 27 | |
| 28 | bool Mutexcxx . . $ Mutex#::tryLockcxx . . $ Mutex#tryLock(83c267b20bac841a).(int timeout) { |
| 29 | bool result; |
| 30 | |
| 31 | if ((result = m_mutexcxx . . $ Mutex#m_mutex.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).tryLockcxx . . $ QMutex#tryLock(109becb148f4ca36).(timeout))) { |
| 32 | setLockedcxx . . $ Mutex#setLocked(49f6e7a06ebc5aa8).(); |
| 33 | } |
| 34 | |
| 35 | return result; |
| 36 | } |
| 37 | |
| 38 | void Mutexcxx . . $ Mutex#::unlockcxx . . $ Mutex#unlock(49f6e7a06ebc5aa8).() { |
| 39 | m_mutexcxx . . $ Mutex#m_mutex.->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).unlockcxx . . $ QBasicMutex#unlock(ced63f7c635d850d).(); |
| 40 | setUnlockedcxx . . $ Mutex#setUnlocked(49f6e7a06ebc5aa8).(); |
| 41 | } |
| 42 | |
| 43 | void Mutexcxx . . $ Mutex#::setLockedcxx . . $ Mutex#setLocked(49f6e7a06ebc5aa8).() { |
| 44 | m_isLockedcxx . . $ Mutex#m_isLocked. = true; |
| 45 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! lockedcxx . . $ Mutex#locked(49f6e7a06ebc5aa8).(); |
| 46 | } |
| 47 | |
| 48 | void Mutexcxx . . $ Mutex#::setUnlockedcxx . . $ Mutex#setUnlocked(49f6e7a06ebc5aa8).() { |
| 49 | m_isLockedcxx . . $ Mutex#m_isLocked. = false; |
| 50 | emitcxx . . $ `<external>/4830994369567095248/qtmetamacros.h:51:10`! unlockedcxx . . $ Mutex#unlocked(49f6e7a06ebc5aa8).(); |
| 51 | } |
| 52 | |
| 53 | bool Mutexcxx . . $ Mutex#::isLockedcxx . . $ Mutex#isLocked(50ce9a9e25b4a850).() const { |
| 54 | return m_isLockedcxx . . $ Mutex#m_isLocked.; |
| 55 | } |
| 56 | |
| 57 | Mutexcxx . . $ Mutex#::operatorcxx . . $ Mutex#`operator QMutex *`(bd9306907d4e3bb). QMutexcxx . . $ QMutex#*() const { |
| 58 | return m_mutexcxx . . $ Mutex#m_mutex..datacxx . . $ QScopedPointer#data(34d6acfd341ba7ab).(); |
| 59 | } |