| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | namespace { | - |
| 6 | enum { | - |
| 7 | StateMask = 0x3, | - |
| 8 | StateLockedForRead = 0x1, | - |
| 9 | StateLockedForWrite = 0x2, | - |
| 10 | }; | - |
| 11 | const auto dummyLockedForRead = reinterpret_cast<QReadWriteLockPrivate *>(quintptr(StateLockedForRead)); | - |
| 12 | const auto dummyLockedForWrite = reinterpret_cast<QReadWriteLockPrivate *>(quintptr(StateLockedForWrite)); | - |
| 13 | inline bool isUncontendedLocked(const QReadWriteLockPrivate *d) | - |
| 14 | { returnexecuted 317361 times by 523 tests: return quintptr(d) & StateMask;Executed by:- tst_QAbstractFileEngine
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_NoApplication
- tst_QDBusConnection_SpyHook
- tst_QDBusServiceWatcher
- tst_QDBusThreading
- tst_QDirIterator
- tst_QFile
- tst_QGlobalStatic
- tst_QMetaType
- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
- tst_collections - unknown status
- tst_compiler - unknown status
- tst_gestures - unknown status
- tst_lancelot - unknown status
- tst_languagechange - unknown status
- tst_largefile - unknown status
- tst_modeltest - unknown status
- tst_networkselftest - unknown status
- tst_platformsocketengine - unknown status
- tst_q_func_info - unknown status
- ...
quintptr(d) & StateMask;executed 317361 times by 523 tests: return quintptr(d) & StateMask;Executed by:- tst_QAbstractFileEngine
- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_NoApplication
- tst_QDBusConnection_SpyHook
- tst_QDBusServiceWatcher
- tst_QDBusThreading
- tst_QDirIterator
- tst_QFile
- tst_QGlobalStatic
- tst_QMetaType
- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
- tst_collections - unknown status
- tst_compiler - unknown status
- tst_gestures - unknown status
- tst_lancelot - unknown status
- tst_languagechange - unknown status
- tst_largefile - unknown status
- tst_modeltest - unknown status
- tst_networkselftest - unknown status
- tst_platformsocketengine - unknown status
- tst_q_func_info - unknown status
- ...
} | 317361 |
| 15 | } | - |
| 16 | QReadWriteLock::QReadWriteLock(RecursionMode recursionMode) | - |
| 17 | : d_ptr(recursionMode == Recursive ? new QReadWriteLockPrivate(true) : nullptr) | - |
| 18 | { | - |
| 19 | ((!(!(quintptr(d_ptr.load()) & StateMask))) ? qt_assert_x("QReadWriteLock::QReadWriteLock", "bad d_ptr alignment",__FILE__,147) : qt_noop()); | - |
| 20 | }executed 42232 times by 296 tests: end of blockExecuted by:- tst_Gestures
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- tst_QBoxLayout
- tst_QButtonGroup
- tst_QCalendarWidget
- ...
| 42232 |
| 21 | | - |
| 22 | | - |
| 23 | | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | QReadWriteLock::~QReadWriteLock() | - |
| 29 | { | - |
| 30 | auto d = d_ptr.load(); | - |
| 31 | if (isUncontendedLocked(d)| TRUE | never evaluated | | FALSE | evaluated 43112 times by 519 testsEvaluated by:- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_NoApplication
- tst_QDBusConnection_SpyHook
- tst_QDBusServiceWatcher
- tst_QDBusThreading
- tst_QGlobalStatic
- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
- tst_collections - unknown status
- tst_compiler - unknown status
- tst_gestures - unknown status
- tst_lancelot - unknown status
- tst_languagechange - unknown status
- tst_largefile - unknown status
- tst_modeltest - unknown status
- tst_networkselftest - unknown status
- tst_platformsocketengine - unknown status
- tst_q_func_info - unknown status
- tst_qabstractanimation - unknown status
- tst_qabstractbutton - unknown status
- tst_qabstractfileengine - unknown status
- tst_qabstractitemmodel - unknown status
- ...
|
) { | 0-43112 |
| 32 | QMessageLogger(__FILE__, 160, __PRETTY_FUNCTION__).warning("QReadWriteLock: destroying locked QReadWriteLock"); | - |
| 33 | return; never executed: return; | 0 |
| 34 | } | - |
| 35 | delete d; | - |
| 36 | }executed 43112 times by 519 tests: end of blockExecuted by:- tst_QDBusAbstractInterface
- tst_QDBusConnection
- tst_QDBusConnection_NoApplication
- tst_QDBusConnection_SpyHook
- tst_QDBusServiceWatcher
- tst_QDBusThreading
- tst_QGlobalStatic
- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
- tst_collections - unknown status
- tst_compiler - unknown status
- tst_gestures - unknown status
- tst_lancelot - unknown status
- tst_languagechange - unknown status
- tst_largefile - unknown status
- tst_modeltest - unknown status
- tst_networkselftest - unknown status
- tst_platformsocketengine - unknown status
- tst_q_func_info - unknown status
- tst_qabstractanimation - unknown status
- tst_qabstractbutton - unknown status
- tst_qabstractfileengine - unknown status
- tst_qabstractitemmodel - unknown status
- ...
| 43112 |
| 37 | void QReadWriteLock::lockForRead() | - |
| 38 | { | - |
| 39 | if (d_ptr.testAndSetAcquire(nullptr, dummyLockedForRead)| TRUE | evaluated 1557572 times by 355 testsEvaluated by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- tst_QBoxLayout
- tst_QButtonGroup
- ...
| | FALSE | evaluated 143670 times by 10 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_Spdy
|
) | 143670-1557572 |
| 40 | return;executed 1557572 times by 355 tests: return;Executed by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- tst_QBoxLayout
- tst_QButtonGroup
- ...
| 1557572 |
| 41 | tryLockForRead(-1); | - |
| 42 | }executed 143670 times by 10 tests: end of blockExecuted by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_Spdy
| 143670 |
| 43 | bool QReadWriteLock::tryLockForRead() | - |
| 44 | { | - |
| 45 | returnexecuted 43 times by 2 tests: return tryLockForRead(0);Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
tryLockForRead(0);executed 43 times by 2 tests: return tryLockForRead(0);Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
| 43 |
| 46 | } | - |
| 47 | bool QReadWriteLock::tryLockForRead(int timeout) | - |
| 48 | { | - |
| 49 | | - |
| 50 | QReadWriteLockPrivate *d; | - |
| 51 | if (d_ptr.testAndSetAcquire(nullptr, dummyLockedForRead, d)| TRUE | evaluated 4 times by 1 test | | FALSE | evaluated 143712 times by 10 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_Spdy
|
) | 4-143712 |
| 52 | returnexecuted 4 times by 1 test: return true; true;executed 4 times by 1 test: return true; | 4 |
| 53 | | - |
| 54 | while (true) { | - |
| 55 | if (d == 0| TRUE | never evaluated | | FALSE | evaluated 143712 times by 10 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_Spdy
|
) { | 0-143712 |
| 56 | if (!d_ptr.testAndSetAcquire(nullptr, dummyLockedForRead, d)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 57 | continue; never executed: continue; | 0 |
| 58 | return never executed: return true; true;never executed: return true; | 0 |
| 59 | } | - |
| 60 | | - |
| 61 | if ((| TRUE | evaluated 11198 times by 6 testsEvaluated by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
| | FALSE | evaluated 132514 times by 6 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
quintptr(d) & StateMask) == StateLockedForRead| TRUE | evaluated 11198 times by 6 testsEvaluated by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
| | FALSE | evaluated 132514 times by 6 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 11198-132514 |
| 62 | | - |
| 63 | const auto val = reinterpret_cast<QReadWriteLockPrivate *>(quintptr(d) + (1U<<4)); | - |
| 64 | ((!(quintptr(val) > (1U<<4))) ? qt_assert_x("QReadWriteLock::tryLockForRead()", "Overflow in lock counter", | - |
| 65 | __FILE__ | - |
| 66 | , | - |
| 67 | 240 | - |
| 68 | ) : qt_noop()) | - |
| 69 | ; | - |
| 70 | if (!d_ptr.testAndSetAcquire(d, val, d)| TRUE | never evaluated | | FALSE | evaluated 11198 times by 6 testsEvaluated by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
|
) | 0-11198 |
| 71 | continue; never executed: continue; | 0 |
| 72 | returnexecuted 11198 times by 6 tests: return true;Executed by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
true;executed 11198 times by 6 tests: return true;Executed by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
| 11198 |
| 73 | } | - |
| 74 | | - |
| 75 | if (d == dummyLockedForWrite| TRUE | evaluated 42 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 132472 times by 6 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 42-132472 |
| 76 | if (!timeout| TRUE | evaluated 2 times by 1 test | | FALSE | evaluated 40 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 2-40 |
| 77 | returnexecuted 2 times by 1 test: return false; false;executed 2 times by 1 test: return false; | 2 |
| 78 | | - |
| 79 | | - |
| 80 | auto val = QReadWriteLockPrivate::allocate(); | - |
| 81 | val->writerCount = 1; | - |
| 82 | if (!d_ptr.testAndSetOrdered(d, val, d)| TRUE | never evaluated | | FALSE | evaluated 40 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 0-40 |
| 83 | val->writerCount = 0; | - |
| 84 | val->release(); | - |
| 85 | continue; never executed: continue; | 0 |
| 86 | } | - |
| 87 | d = val; | - |
| 88 | }executed 40 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 40 |
| 89 | ((!(!isUncontendedLocked(d))) ? qt_assert("!isUncontendedLocked(d)",__FILE__,260) : qt_noop()); | - |
| 90 | | - |
| 91 | | - |
| 92 | if (d->recursive| TRUE | evaluated 126 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 132386 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 126-132386 |
| 93 | returnexecuted 126 times by 5 tests: return d->recursiveLockForRead(timeout);Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
d->recursiveLockForRead(timeout);executed 126 times by 5 tests: return d->recursiveLockForRead(timeout);Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| 126 |
| 94 | | - |
| 95 | QMutexLocker lock(&d->mutex); | - |
| 96 | if (d != d_ptr.load()| TRUE | never evaluated | | FALSE | evaluated 132386 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 0-132386 |
| 97 | | - |
| 98 | | - |
| 99 | | - |
| 100 | | - |
| 101 | | - |
| 102 | | - |
| 103 | d = d_ptr.loadAcquire(); | - |
| 104 | continue; never executed: continue; | 0 |
| 105 | } | - |
| 106 | returnexecuted 132386 times by 3 tests: return d->lockForRead(timeout);Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
d->lockForRead(timeout);executed 132386 times by 3 tests: return d->lockForRead(timeout);Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 132386 |
| 107 | } | - |
| 108 | } never executed: end of block | 0 |
| 109 | void QReadWriteLock::lockForWrite() | - |
| 110 | { | - |
| 111 | tryLockForWrite(-1); | - |
| 112 | }executed 348346 times by 568 tests: end of blockExecuted by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- ...
| 348346 |
| 113 | bool QReadWriteLock::tryLockForWrite() | - |
| 114 | { | - |
| 115 | returnexecuted 62 times by 4 tests: return tryLockForWrite(0);Executed by:- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
tryLockForWrite(0);executed 62 times by 4 tests: return tryLockForWrite(0);Executed by:- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
| 62 |
| 116 | } | - |
| 117 | bool QReadWriteLock::tryLockForWrite(int timeout) | - |
| 118 | { | - |
| 119 | | - |
| 120 | QReadWriteLockPrivate *d; | - |
| 121 | if (d_ptr.testAndSetAcquire(nullptr, dummyLockedForWrite, d)| TRUE | evaluated 345353 times by 565 testsEvaluated by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- tst_QBoxLayout
- ...
| | FALSE | evaluated 3057 times by 11 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) | 3057-345353 |
| 122 | returnexecuted 345353 times by 565 tests: return true;Executed by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- tst_QBoxLayout
- ...
true;executed 345353 times by 565 tests: return true;Executed by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- tst_QBoxLayout
- ...
| 345353 |
| 123 | | - |
| 124 | while (true) { | - |
| 125 | if (d == 0| TRUE | never evaluated | | FALSE | evaluated 3057 times by 11 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) { | 0-3057 |
| 126 | if (!d_ptr.testAndSetAcquire(d, dummyLockedForWrite, d)| TRUE | never evaluated | | FALSE | never evaluated |
) | 0 |
| 127 | continue; never executed: continue; | 0 |
| 128 | return never executed: return true; true;never executed: return true; | 0 |
| 129 | } | - |
| 130 | | - |
| 131 | if (isUncontendedLocked(d)| TRUE | evaluated 88 times by 5 testsEvaluated by:- tst_QMetaType
- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_QWriteLocker
| | FALSE | evaluated 2969 times by 9 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) { | 88-2969 |
| 132 | if (!timeout| TRUE | evaluated 10 times by 3 testsEvaluated by:- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWriteLocker
| | FALSE | evaluated 78 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 10-78 |
| 133 | returnexecuted 10 times by 3 tests: return false;Executed by:- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWriteLocker
false;executed 10 times by 3 tests: return false;Executed by:- tst_QReadLocker
- tst_QReadWriteLock
- tst_QWriteLocker
| 10 |
| 134 | | - |
| 135 | | - |
| 136 | auto val = QReadWriteLockPrivate::allocate(); | - |
| 137 | if (d == dummyLockedForWrite| TRUE | evaluated 54 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 24 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 24-54 |
| 138 | val->writerCount = 1;executed 54 times by 3 tests: val->writerCount = 1;Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 54 |
| 139 | else | - |
| 140 | val->readerCount = (quintptr(d) >> 4) + 1;executed 24 times by 3 tests: val->readerCount = (quintptr(d) >> 4) + 1;Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 24 |
| 141 | if (!d_ptr.testAndSetOrdered(d, val, d)| TRUE | never evaluated | | FALSE | evaluated 78 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 0-78 |
| 142 | val->writerCount = val->readerCount = 0; | - |
| 143 | val->release(); | - |
| 144 | continue; never executed: continue; | 0 |
| 145 | } | - |
| 146 | d = val; | - |
| 147 | }executed 78 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 78 |
| 148 | ((!(!isUncontendedLocked(d))) ? qt_assert("!isUncontendedLocked(d)",__FILE__,367) : qt_noop()); | - |
| 149 | | - |
| 150 | | - |
| 151 | if (d->recursive| TRUE | evaluated 76 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| | FALSE | evaluated 2971 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 76-2971 |
| 152 | returnexecuted 76 times by 8 tests: return d->recursiveLockForWrite(timeout);Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
d->recursiveLockForWrite(timeout);executed 76 times by 8 tests: return d->recursiveLockForWrite(timeout);Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| 76 |
| 153 | | - |
| 154 | QMutexLocker lock(&d->mutex); | - |
| 155 | if (d != d_ptr.load()| TRUE | never evaluated | | FALSE | evaluated 2971 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 0-2971 |
| 156 | | - |
| 157 | | - |
| 158 | | - |
| 159 | d = d_ptr.loadAcquire(); | - |
| 160 | continue; never executed: continue; | 0 |
| 161 | } | - |
| 162 | returnexecuted 2971 times by 3 tests: return d->lockForWrite(timeout);Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
d->lockForWrite(timeout);executed 2971 times by 3 tests: return d->lockForWrite(timeout);Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 2971 |
| 163 | } | - |
| 164 | } never executed: end of block | 0 |
| 165 | void QReadWriteLock::unlock() | - |
| 166 | { | - |
| 167 | QReadWriteLockPrivate *d = d_ptr.load(); | - |
| 168 | while (true) { | - |
| 169 | ((!(d)) ? qt_assert_x("QReadWriteLock::unlock()", "Cannot unlock an unlocked lock",__FILE__,397) : qt_noop()); | - |
| 170 | | - |
| 171 | | - |
| 172 | if (quintptr(d) <= 2| TRUE | evaluated 1902811 times by 572 testsEvaluated by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- ...
| | FALSE | evaluated 146830 times by 13 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_Spdy
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) { | 146830-1902811 |
| 173 | if (!d_ptr.testAndSetRelease(d, nullptr, d)| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 1902810 times by 572 testsEvaluated by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- ...
|
) | 1-1902810 |
| 174 | continue;executed 1 time by 1 test: continue; | 1 |
| 175 | return;executed 1902810 times by 572 tests: return;Executed by:- tst_Gestures
- tst_Lancelot
- tst_ModelTest
- tst_NetworkSelfTest
- tst_QAbstractButton
- tst_QAbstractFileEngine
- tst_QAbstractItemModel
- tst_QAbstractItemView
- tst_QAbstractNetworkCache
- tst_QAbstractPrintDialog
- tst_QAbstractProxyModel
- tst_QAbstractScrollArea
- tst_QAbstractSlider
- tst_QAbstractSpinBox
- tst_QAbstractTextDocumentLayout
- tst_QAccessibility
- tst_QAction
- tst_QActionGroup
- tst_QAlgorithms
- tst_QAnimationGroup
- tst_QApplication
- tst_QArrayData
- tst_QArrayData_StrictIterators
- tst_QAsn1Element
- tst_QBackingStore
- ...
| 1902810 |
| 176 | } | - |
| 177 | | - |
| 178 | if ((| TRUE | evaluated 11197 times by 6 testsEvaluated by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
| | FALSE | evaluated 135633 times by 9 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
quintptr(d) & StateMask) == StateLockedForRead| TRUE | evaluated 11197 times by 6 testsEvaluated by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
| | FALSE | evaluated 135633 times by 9 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) { | 11197-135633 |
| 179 | ((!(quintptr(d) > (1U<<4))) ? qt_assert("quintptr(d) > (1U<<4)",__FILE__,407) : qt_noop()); | - |
| 180 | | - |
| 181 | auto val = reinterpret_cast<QReadWriteLockPrivate *>(quintptr(d) - (1U<<4)); | - |
| 182 | if (!d_ptr.testAndSetRelease(d, val, d)| TRUE | never evaluated | | FALSE | evaluated 11197 times by 6 testsEvaluated by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
|
) | 0-11197 |
| 183 | continue; never executed: continue; | 0 |
| 184 | return;executed 11197 times by 6 tests: return;Executed by:- tst_QGuiEventLoop
- tst_QHostInfo
- tst_QMetaType
- tst_QNetworkReply
- tst_QReadWriteLock
- tst_Spdy
| 11197 |
| 185 | } | - |
| 186 | | - |
| 187 | ((!(!isUncontendedLocked(d))) ? qt_assert("!isUncontendedLocked(d)",__FILE__,415) : qt_noop()); | - |
| 188 | | - |
| 189 | if (d->recursive| TRUE | evaluated 159 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| | FALSE | evaluated 135474 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 159-135474 |
| 190 | d->recursiveUnlock(); | - |
| 191 | return;executed 159 times by 8 tests: return;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| 159 |
| 192 | } | - |
| 193 | | - |
| 194 | QMutexLocker locker(&d->mutex); | - |
| 195 | if (d->writerCount| TRUE | evaluated 3064 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 132410 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 3064-132410 |
| 196 | ((!(d->writerCount == 1)) ? qt_assert("d->writerCount == 1",__FILE__,424) : qt_noop()); | - |
| 197 | ((!(d->readerCount == 0)) ? qt_assert("d->readerCount == 0",__FILE__,425) : qt_noop()); | - |
| 198 | d->writerCount = 0; | - |
| 199 | }executed 3064 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
else { | 3064 |
| 200 | ((!(d->readerCount > 0)) ? qt_assert("d->readerCount > 0",__FILE__,428) : qt_noop()); | - |
| 201 | d->readerCount--; | - |
| 202 | if (d->readerCount > 0| TRUE | evaluated 132145 times by 1 test | | FALSE | evaluated 265 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 265-132145 |
| 203 | return;executed 132145 times by 1 test: return; | 132145 |
| 204 | }executed 265 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 265 |
| 205 | | - |
| 206 | if (d->waitingReaders| TRUE | evaluated 327 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 3002 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
|| d->waitingWriters| TRUE | evaluated 2884 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 118 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 118-3002 |
| 207 | d->unlock(); | - |
| 208 | }executed 3211 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
else { | 3211 |
| 209 | ((!(d_ptr.load() == d)) ? qt_assert("d_ptr.load() == d",__FILE__,437) : qt_noop()); | - |
| 210 | d_ptr.storeRelease(nullptr); | - |
| 211 | d->release(); | - |
| 212 | }executed 118 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 118 |
| 213 | return;executed 3329 times by 3 tests: return;Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 3329 |
| 214 | } | - |
| 215 | } never executed: end of block | 0 |
| 216 | | - |
| 217 | | - |
| 218 | QReadWriteLock::StateForWaitCondition QReadWriteLock::stateForWaitCondition() const | - |
| 219 | { | - |
| 220 | QReadWriteLockPrivate *d = d_ptr.load(); | - |
| 221 | switch (quintptr(d) & StateMask) { | - |
| 222 | caseexecuted 25 times by 1 test: case StateLockedForRead: StateLockedForRead:executed 25 times by 1 test: case StateLockedForRead: returnexecuted 25 times by 1 test: return LockedForRead; LockedForRead;executed 25 times by 1 test: return LockedForRead; | 25 |
| 223 | caseexecuted 108 times by 1 test: case StateLockedForWrite: StateLockedForWrite:executed 108 times by 1 test: case StateLockedForWrite: returnexecuted 108 times by 1 test: return LockedForWrite; LockedForWrite;executed 108 times by 1 test: return LockedForWrite; | 108 |
| 224 | } | - |
| 225 | | - |
| 226 | if (!d| TRUE | never evaluated | | FALSE | evaluated 141 times by 1 test |
) | 0-141 |
| 227 | return never executed: return Unlocked; Unlocked;never executed: return Unlocked; | 0 |
| 228 | if (d->writerCount > 1| TRUE | never evaluated | | FALSE | evaluated 141 times by 1 test |
) | 0-141 |
| 229 | return never executed: return RecursivelyLocked; RecursivelyLocked;never executed: return RecursivelyLocked; | 0 |
| 230 | else if (d->writerCount == 1| TRUE | evaluated 123 times by 1 test | | FALSE | evaluated 18 times by 1 test |
) | 18-123 |
| 231 | returnexecuted 123 times by 1 test: return LockedForWrite; LockedForWrite;executed 123 times by 1 test: return LockedForWrite; | 123 |
| 232 | returnexecuted 18 times by 1 test: return LockedForRead; LockedForRead;executed 18 times by 1 test: return LockedForRead; | 18 |
| 233 | | - |
| 234 | } | - |
| 235 | | - |
| 236 | bool QReadWriteLockPrivate::lockForRead(int timeout) | - |
| 237 | { | - |
| 238 | ((!(!mutex.tryLock())) ? qt_assert("!mutex.tryLock()",__FILE__,466) : qt_noop()); | - |
| 239 | | - |
| 240 | QElapsedTimer t; | - |
| 241 | if (timeout > 0| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 132492 times by 6 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 1-132492 |
| 242 | t.start();executed 1 time by 1 test: t.start(); | 1 |
| 243 | | - |
| 244 | while (waitingWriters| TRUE | evaluated 386 times by 2 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
| | FALSE | evaluated 132543 times by 6 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
|| writerCount| TRUE | evaluated 72 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 132471 times by 6 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 72-132543 |
| 245 | if (timeout == 0| TRUE | evaluated 21 times by 2 testsEvaluated by:- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 437 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 21-437 |
| 246 | returnexecuted 21 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
false;executed 21 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
| 21 |
| 247 | if (timeout > 0| TRUE | evaluated 8 times by 1 test | | FALSE | evaluated 429 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 8-429 |
| 248 | auto elapsed = t.elapsed(); | - |
| 249 | if (elapsed > timeout| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 7 times by 1 test |
) | 1-7 |
| 250 | returnexecuted 1 time by 1 test: return false; false;executed 1 time by 1 test: return false; | 1 |
| 251 | waitingReaders++; | - |
| 252 | readerCond.wait(&mutex, timeout - elapsed); | - |
| 253 | }executed 7 times by 1 test: end of block else { | 7 |
| 254 | waitingReaders++; | - |
| 255 | readerCond.wait(&mutex); | - |
| 256 | }executed 429 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 429 |
| 257 | waitingReaders--; | - |
| 258 | }executed 436 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 436 |
| 259 | readerCount++; | - |
| 260 | ((!(writerCount == 0)) ? qt_assert("writerCount == 0",__FILE__,488) : qt_noop()); | - |
| 261 | returnexecuted 132471 times by 6 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
true;executed 132471 times by 6 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 132471 |
| 262 | } | - |
| 263 | | - |
| 264 | bool QReadWriteLockPrivate::lockForWrite(int timeout) | - |
| 265 | { | - |
| 266 | ((!(!mutex.tryLock())) ? qt_assert("!mutex.tryLock()",__FILE__,494) : qt_noop()); | - |
| 267 | | - |
| 268 | QElapsedTimer t; | - |
| 269 | if (timeout > 0| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 3034 times by 9 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) | 1-3034 |
| 270 | t.start();executed 1 time by 1 test: t.start(); | 1 |
| 271 | | - |
| 272 | while (readerCount| TRUE | evaluated 74 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 3276 times by 9 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
|| writerCount| TRUE | evaluated 264 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 3012 times by 9 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) { | 74-3276 |
| 273 | if (timeout == 0| TRUE | evaluated 22 times by 2 testsEvaluated by:- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 316 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 22-316 |
| 274 | returnexecuted 22 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
false;executed 22 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
| 22 |
| 275 | if (timeout > 0| TRUE | evaluated 8 times by 1 test | | FALSE | evaluated 308 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 8-308 |
| 276 | auto elapsed = t.elapsed(); | - |
| 277 | if (elapsed > timeout| TRUE | evaluated 1 time by 1 test | | FALSE | evaluated 7 times by 1 test |
) { | 1-7 |
| 278 | if (waitingReaders| TRUE | never evaluated | | FALSE | evaluated 1 time by 1 test |
&& !waitingWriters| TRUE | never evaluated | | FALSE | never evaluated |
&& !writerCount| TRUE | never evaluated | | FALSE | never evaluated |
) { | 0-1 |
| 279 | | - |
| 280 | | - |
| 281 | readerCond.wakeAll(); | - |
| 282 | } never executed: end of block | 0 |
| 283 | returnexecuted 1 time by 1 test: return false; false;executed 1 time by 1 test: return false; | 1 |
| 284 | } | - |
| 285 | waitingWriters++; | - |
| 286 | writerCond.wait(&mutex, timeout - elapsed); | - |
| 287 | }executed 7 times by 1 test: end of block else { | 7 |
| 288 | waitingWriters++; | - |
| 289 | writerCond.wait(&mutex); | - |
| 290 | }executed 308 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 308 |
| 291 | waitingWriters--; | - |
| 292 | }executed 315 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 315 |
| 293 | | - |
| 294 | ((!(writerCount == 0)) ? qt_assert("writerCount == 0",__FILE__,522) : qt_noop()); | - |
| 295 | ((!(readerCount == 0)) ? qt_assert("readerCount == 0",__FILE__,523) : qt_noop()); | - |
| 296 | writerCount = 1; | - |
| 297 | returnexecuted 3012 times by 9 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
true;executed 3012 times by 9 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| 3012 |
| 298 | } | - |
| 299 | | - |
| 300 | void QReadWriteLockPrivate::unlock() | - |
| 301 | { | - |
| 302 | ((!(!mutex.tryLock())) ? qt_assert("!mutex.tryLock()",__FILE__,530) : qt_noop()); | - |
| 303 | if (waitingWriters| TRUE | evaluated 2922 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 417 times by 9 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) | 417-2922 |
| 304 | writerCond.wakeOne();executed 2922 times by 3 tests: writerCond.wakeOne();Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 2922 |
| 305 | else if (waitingReaders| TRUE | evaluated 290 times by 3 testsEvaluated by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 127 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) | 127-290 |
| 306 | readerCond.wakeAll();executed 290 times by 3 tests: readerCond.wakeAll();Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 290 |
| 307 | }executed 3339 times by 9 tests: end of blockExecuted by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| 3339 |
| 308 | | - |
| 309 | bool QReadWriteLockPrivate::recursiveLockForRead(int timeout) | - |
| 310 | { | - |
| 311 | ((!(recursive)) ? qt_assert("recursive",__FILE__,539) : qt_noop()); | - |
| 312 | QMutexLocker lock(&mutex); | - |
| 313 | | - |
| 314 | Qt::HANDLE self = QThread::currentThreadId(); | - |
| 315 | | - |
| 316 | auto it = currentReaders.find(self); | - |
| 317 | if (it != currentReaders.end()| TRUE | evaluated 19 times by 4 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 107 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 19-107 |
| 318 | ++it.value(); | - |
| 319 | returnexecuted 19 times by 4 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
true;executed 19 times by 4 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| 19 |
| 320 | } | - |
| 321 | | - |
| 322 | if (!lockForRead(timeout)| TRUE | evaluated 21 times by 2 testsEvaluated by:- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 86 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 21-86 |
| 323 | returnexecuted 21 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
false;executed 21 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
| 21 |
| 324 | | - |
| 325 | currentReaders.insert(self, 1); | - |
| 326 | returnexecuted 86 times by 5 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
true;executed 86 times by 5 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| 86 |
| 327 | } | - |
| 328 | | - |
| 329 | bool QReadWriteLockPrivate::recursiveLockForWrite(int timeout) | - |
| 330 | { | - |
| 331 | ((!(recursive)) ? qt_assert("recursive",__FILE__,559) : qt_noop()); | - |
| 332 | QMutexLocker lock(&mutex); | - |
| 333 | | - |
| 334 | Qt::HANDLE self = QThread::currentThreadId(); | - |
| 335 | if (currentWriter == self| TRUE | evaluated 12 times by 2 testsEvaluated by:- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 64 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) { | 12-64 |
| 336 | writerCount++; | - |
| 337 | returnexecuted 12 times by 2 tests: return true;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
true;executed 12 times by 2 tests: return true;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
| 12 |
| 338 | } | - |
| 339 | | - |
| 340 | if (!lockForWrite(timeout)| TRUE | evaluated 22 times by 2 testsEvaluated by:- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 42 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) | 22-42 |
| 341 | returnexecuted 22 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
false;executed 22 times by 2 tests: return false;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
| 22 |
| 342 | | - |
| 343 | currentWriter = self; | - |
| 344 | returnexecuted 42 times by 8 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
true;executed 42 times by 8 tests: return true;Executed by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| 42 |
| 345 | } | - |
| 346 | | - |
| 347 | void QReadWriteLockPrivate::recursiveUnlock() | - |
| 348 | { | - |
| 349 | ((!(recursive)) ? qt_assert("recursive",__FILE__,577) : qt_noop()); | - |
| 350 | QMutexLocker lock(&mutex); | - |
| 351 | | - |
| 352 | Qt::HANDLE self = QThread::currentThreadId(); | - |
| 353 | if (self == currentWriter| TRUE | evaluated 54 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| | FALSE | evaluated 105 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 54-105 |
| 354 | if (--| TRUE | evaluated 12 times by 2 testsEvaluated by:- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 42 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
writerCount > 0| TRUE | evaluated 12 times by 2 testsEvaluated by:- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 42 times by 8 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
|
) | 12-42 |
| 355 | return;executed 12 times by 2 tests: return;Executed by:- tst_QReadWriteLock
- tst_QWaitCondition
| 12 |
| 356 | currentWriter = 0; | - |
| 357 | }executed 42 times by 8 tests: end of blockExecuted by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
else { | 42 |
| 358 | auto it = currentReaders.find(self); | - |
| 359 | if (it == currentReaders.end()| TRUE | never evaluated | | FALSE | evaluated 105 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 0-105 |
| 360 | QMessageLogger(__FILE__, 588, __PRETTY_FUNCTION__).warning("QReadWriteLock::unlock: unlocking from a thread that did not lock"); | - |
| 361 | return; never executed: return; | 0 |
| 362 | } else { | - |
| 363 | if (--| TRUE | evaluated 86 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 19 times by 4 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
|
it.value() <= 0| TRUE | evaluated 86 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 19 times by 4 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
|
) { | 19-86 |
| 364 | currentReaders.erase(it); | - |
| 365 | readerCount--; | - |
| 366 | }executed 86 times by 5 tests: end of blockExecuted by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| 86 |
| 367 | if (readerCount| TRUE | evaluated 19 times by 4 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| | FALSE | evaluated 86 times by 5 testsEvaluated by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
|
) | 19-86 |
| 368 | return;executed 19 times by 4 tests: return;Executed by:- tst_QAbstractFileEngine
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| 19 |
| 369 | }executed 86 times by 5 tests: end of blockExecuted by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
| 86 |
| 370 | } | - |
| 371 | | - |
| 372 | unlock(); | - |
| 373 | }executed 128 times by 8 tests: end of blockExecuted by:- tst_QAbstractFileEngine
- tst_QDirIterator
- tst_QFile
- tst_QReadWriteLock
- tst_QWaitCondition
- tst_qabstractfileengine - unknown status
- tst_qdiriterator - unknown status
- tst_qfile - unknown status
| 128 |
| 374 | | - |
| 375 | | - |
| 376 | namespace { | - |
| 377 | struct FreeListConstants : QFreeListDefaultConstants { | - |
| 378 | enum { BlockCount = 4, MaxIndex=0xffff }; | - |
| 379 | static const int Sizes[BlockCount]; | - |
| 380 | }; | - |
| 381 | const int FreeListConstants::Sizes[FreeListConstants::BlockCount] = { | - |
| 382 | 16, | - |
| 383 | 128, | - |
| 384 | 1024, | - |
| 385 | FreeListConstants::MaxIndex - (16 + 128 + 1024) | - |
| 386 | }; | - |
| 387 | | - |
| 388 | typedef QFreeList<QReadWriteLockPrivate, FreeListConstants> FreeList; | - |
| 389 | namespace { namespace Q_QGS_freelist { typedef FreeList Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized| TRUE | evaluated 3 times by 3 testsEvaluated by:- tst_qmetatype - unknown status
- tst_qreadwritelock - unknown status
- tst_qwaitcondition - unknown status
| | FALSE | never evaluated |
) guard.store(QtGlobalStatic::Destroyed);executed 3 times by 3 tests: guard.store(QtGlobalStatic::Destroyed);Executed by:- tst_qmetatype - unknown status
- tst_qreadwritelock - unknown status
- tst_qwaitcondition - unknown status
}executed 3 times by 3 tests: end of blockExecuted by:- tst_qmetatype - unknown status
- tst_qreadwritelock - unknown status
- tst_qwaitcondition - unknown status
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnexecuted 354 times by 3 tests: return &holder.value;Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
&holder.value;executed 354 times by 3 tests: return &holder.value;Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
} } } static QGlobalStatic<FreeList, Q_QGS_freelist::innerFunction, Q_QGS_freelist::guard> freelist;; | 0-354 |
| 390 | } | - |
| 391 | | - |
| 392 | QReadWriteLockPrivate *QReadWriteLockPrivate::allocate() | - |
| 393 | { | - |
| 394 | int i = freelist->next(); | - |
| 395 | QReadWriteLockPrivate *d = &(*freelist)[i]; | - |
| 396 | d->id = i; | - |
| 397 | ((!(!d->recursive)) ? qt_assert("!d->recursive",__FILE__,625) : qt_noop()); | - |
| 398 | ((!(!d->waitingReaders && !d->waitingReaders && !d->readerCount && !d->writerCount)) ? qt_assert("!d->waitingReaders && !d->waitingReaders && !d->readerCount && !d->writerCount",__FILE__,626) : qt_noop()); | - |
| 399 | returnexecuted 118 times by 3 tests: return d;Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
d;executed 118 times by 3 tests: return d;Executed by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 118 |
| 400 | } | - |
| 401 | | - |
| 402 | void QReadWriteLockPrivate::release() | - |
| 403 | { | - |
| 404 | ((!(!recursive)) ? qt_assert("!recursive",__FILE__,632) : qt_noop()); | - |
| 405 | ((!(!waitingReaders && !waitingReaders && !readerCount && !writerCount)) ? qt_assert("!waitingReaders && !waitingReaders && !readerCount && !writerCount",__FILE__,633) : qt_noop()); | - |
| 406 | freelist->release(id); | - |
| 407 | }executed 118 times by 3 tests: end of blockExecuted by:- tst_QMetaType
- tst_QReadWriteLock
- tst_QWaitCondition
| 118 |
| 408 | | - |
| | |