| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/corelib/thread/qfutureinterface.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | - | |||||||||||||||||||
| 7 | - | |||||||||||||||||||
| 8 | enum { | - | ||||||||||||||||||
| 9 | MaxProgressEmitsPerSecond = 25 | - | ||||||||||||||||||
| 10 | }; | - | ||||||||||||||||||
| 11 | - | |||||||||||||||||||
| 12 | namespace { | - | ||||||||||||||||||
| 13 | class ThreadPoolThreadReleaser { | - | ||||||||||||||||||
| 14 | QThreadPool *m_pool; | - | ||||||||||||||||||
| 15 | public: | - | ||||||||||||||||||
| 16 | explicit ThreadPoolThreadReleaser(QThreadPool *pool) | - | ||||||||||||||||||
| 17 | : m_pool(pool) | - | ||||||||||||||||||
| 18 | { if (pool
never executed: }pool->releaseThread();never executed: end of block | 0 | ||||||||||||||||||
| 19 | ~ThreadPoolThreadReleaser() | - | ||||||||||||||||||
| 20 | { if (m_pool
never executed: }m_pool->reserveThread();never executed: end of block | 0 | ||||||||||||||||||
| 21 | }; | - | ||||||||||||||||||
| 22 | } | - | ||||||||||||||||||
| 23 | - | |||||||||||||||||||
| 24 | - | |||||||||||||||||||
| 25 | QFutureInterfaceBase::QFutureInterfaceBase(State initialState) | - | ||||||||||||||||||
| 26 | : d(new QFutureInterfaceBasePrivate(initialState)) | - | ||||||||||||||||||
| 27 | { } executed 128690 times by 12 tests: end of blockExecuted by:
| 128690 | ||||||||||||||||||
| 28 | - | |||||||||||||||||||
| 29 | QFutureInterfaceBase::QFutureInterfaceBase(const QFutureInterfaceBase &other) | - | ||||||||||||||||||
| 30 | : d(other.d) | - | ||||||||||||||||||
| 31 | { | - | ||||||||||||||||||
| 32 | d->refCount.ref(); | - | ||||||||||||||||||
| 33 | } executed 160412 times by 12 tests: end of blockExecuted by:
| 160412 | ||||||||||||||||||
| 34 | - | |||||||||||||||||||
| 35 | QFutureInterfaceBase::~QFutureInterfaceBase() | - | ||||||||||||||||||
| 36 | { | - | ||||||||||||||||||
| 37 | if (!d->refCount.deref()
| 128616-160486 | ||||||||||||||||||
| 38 | delete d; executed 128616 times by 14 tests: delete d;Executed by:
| 128616 | ||||||||||||||||||
| 39 | } executed 289102 times by 14 tests: end of blockExecuted by:
| 289102 | ||||||||||||||||||
| 40 | - | |||||||||||||||||||
| 41 | static inline int switch_on(QAtomicInt &a, int which) | - | ||||||||||||||||||
| 42 | { | - | ||||||||||||||||||
| 43 | return executed 38 times by 5 tests: a.fetchAndOrRelaxed(which) | which;return a.fetchAndOrRelaxed(which) | which;Executed by:
executed 38 times by 5 tests: return a.fetchAndOrRelaxed(which) | which;Executed by:
| 38 | ||||||||||||||||||
| 44 | } | - | ||||||||||||||||||
| 45 | - | |||||||||||||||||||
| 46 | static inline int switch_off(QAtomicInt &a, int which) | - | ||||||||||||||||||
| 47 | { | - | ||||||||||||||||||
| 48 | return executed 26 times by 2 tests: a.fetchAndAndRelaxed(~which) & ~which;return a.fetchAndAndRelaxed(~which) & ~which;Executed by:
executed 26 times by 2 tests: return a.fetchAndAndRelaxed(~which) & ~which;Executed by:
| 26 | ||||||||||||||||||
| 49 | } | - | ||||||||||||||||||
| 50 | - | |||||||||||||||||||
| 51 | static inline int switch_from_to(QAtomicInt &a, int from, int to) | - | ||||||||||||||||||
| 52 | { | - | ||||||||||||||||||
| 53 | int newValue; | - | ||||||||||||||||||
| 54 | int expected = a.load(); | - | ||||||||||||||||||
| 55 | do { | - | ||||||||||||||||||
| 56 | newValue = (expected & ~from) | to; | - | ||||||||||||||||||
| 57 | } executed 129440 times by 11 tests: while (!a.testAndSetRelaxed(expected, newValue, expected)end of blockExecuted by:
| 0-129440 | ||||||||||||||||||
| 58 | return executed 129440 times by 11 tests: newValue;return newValue;Executed by:
executed 129440 times by 11 tests: return newValue;Executed by:
| 129440 | ||||||||||||||||||
| 59 | } | - | ||||||||||||||||||
| 60 | - | |||||||||||||||||||
| 61 | void QFutureInterfaceBase::cancel() | - | ||||||||||||||||||
| 62 | { | - | ||||||||||||||||||
| 63 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 64 | if (d->state.load() & Canceled
| 5-1112 | ||||||||||||||||||
| 65 | return; executed 5 times by 1 test: return;Executed by:
| 5 | ||||||||||||||||||
| 66 | - | |||||||||||||||||||
| 67 | switch_from_to(d->state, Paused, Canceled); | - | ||||||||||||||||||
| 68 | d->waitCondition.wakeAll(); | - | ||||||||||||||||||
| 69 | d->pausedWaitCondition.wakeAll(); | - | ||||||||||||||||||
| 70 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled)); | - | ||||||||||||||||||
| 71 | } executed 1112 times by 4 tests: end of blockExecuted by:
| 1112 | ||||||||||||||||||
| 72 | - | |||||||||||||||||||
| 73 | void QFutureInterfaceBase::setPaused(bool paused) | - | ||||||||||||||||||
| 74 | { | - | ||||||||||||||||||
| 75 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 76 | if (paused
| 9 | ||||||||||||||||||
| 77 | switch_on(d->state, Paused); | - | ||||||||||||||||||
| 78 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused)); | - | ||||||||||||||||||
| 79 | } executed 9 times by 2 tests: else {end of blockExecuted by:
| 9 | ||||||||||||||||||
| 80 | switch_off(d->state, Paused); | - | ||||||||||||||||||
| 81 | d->pausedWaitCondition.wakeAll(); | - | ||||||||||||||||||
| 82 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed)); | - | ||||||||||||||||||
| 83 | } executed 9 times by 2 tests: end of blockExecuted by:
| 9 | ||||||||||||||||||
| 84 | } | - | ||||||||||||||||||
| 85 | - | |||||||||||||||||||
| 86 | void QFutureInterfaceBase::togglePaused() | - | ||||||||||||||||||
| 87 | { | - | ||||||||||||||||||
| 88 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 89 | if (d->state.load() & Paused
| 1-7 | ||||||||||||||||||
| 90 | switch_off(d->state, Paused); | - | ||||||||||||||||||
| 91 | d->pausedWaitCondition.wakeAll(); | - | ||||||||||||||||||
| 92 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Resumed)); | - | ||||||||||||||||||
| 93 | } executed 1 time by 1 test: else {end of blockExecuted by:
| 1 | ||||||||||||||||||
| 94 | switch_on(d->state, Paused); | - | ||||||||||||||||||
| 95 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Paused)); | - | ||||||||||||||||||
| 96 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||||||||
| 97 | } | - | ||||||||||||||||||
| 98 | - | |||||||||||||||||||
| 99 | void QFutureInterfaceBase::setThrottled(bool enable) | - | ||||||||||||||||||
| 100 | { | - | ||||||||||||||||||
| 101 | QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 102 | if (enable
| 2-16 | ||||||||||||||||||
| 103 | switch_on(d->state, Throttled); | - | ||||||||||||||||||
| 104 | } executed 2 times by 1 test: else {end of blockExecuted by:
| 2 | ||||||||||||||||||
| 105 | switch_off(d->state, Throttled); | - | ||||||||||||||||||
| 106 | if (!(d->state.load() & Paused)
| 0-16 | ||||||||||||||||||
| 107 | d->pausedWaitCondition.wakeAll(); executed 16 times by 2 tests: d->pausedWaitCondition.wakeAll();Executed by:
| 16 | ||||||||||||||||||
| 108 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||
| 109 | } | - | ||||||||||||||||||
| 110 | - | |||||||||||||||||||
| 111 | - | |||||||||||||||||||
| 112 | bool QFutureInterfaceBase::isRunning() const | - | ||||||||||||||||||
| 113 | { | - | ||||||||||||||||||
| 114 | return executed 322807 times by 12 tests: queryState(Running);return queryState(Running);Executed by:
executed 322807 times by 12 tests: return queryState(Running);Executed by:
| 322807 | ||||||||||||||||||
| 115 | } | - | ||||||||||||||||||
| 116 | - | |||||||||||||||||||
| 117 | bool QFutureInterfaceBase::isStarted() const | - | ||||||||||||||||||
| 118 | { | - | ||||||||||||||||||
| 119 | return executed 28 times by 2 tests: queryState(Started);return queryState(Started);Executed by:
executed 28 times by 2 tests: return queryState(Started);Executed by:
| 28 | ||||||||||||||||||
| 120 | } | - | ||||||||||||||||||
| 121 | - | |||||||||||||||||||
| 122 | bool QFutureInterfaceBase::isCanceled() const | - | ||||||||||||||||||
| 123 | { | - | ||||||||||||||||||
| 124 | return executed 202250 times by 11 tests: queryState(Canceled);return queryState(Canceled);Executed by:
executed 202250 times by 11 tests: return queryState(Canceled);Executed by:
| 202250 | ||||||||||||||||||
| 125 | } | - | ||||||||||||||||||
| 126 | - | |||||||||||||||||||
| 127 | bool QFutureInterfaceBase::isFinished() const | - | ||||||||||||||||||
| 128 | { | - | ||||||||||||||||||
| 129 | return executed 128856 times by 12 tests: queryState(Finished);return queryState(Finished);Executed by:
executed 128856 times by 12 tests: return queryState(Finished);Executed by:
| 128856 | ||||||||||||||||||
| 130 | } | - | ||||||||||||||||||
| 131 | - | |||||||||||||||||||
| 132 | bool QFutureInterfaceBase::isPaused() const | - | ||||||||||||||||||
| 133 | { | - | ||||||||||||||||||
| 134 | return executed 13517 times by 6 tests: queryState(Paused);return queryState(Paused);Executed by:
executed 13517 times by 6 tests: return queryState(Paused);Executed by:
| 13517 | ||||||||||||||||||
| 135 | } | - | ||||||||||||||||||
| 136 | - | |||||||||||||||||||
| 137 | bool QFutureInterfaceBase::isThrottled() const | - | ||||||||||||||||||
| 138 | { | - | ||||||||||||||||||
| 139 | return executed 7 times by 2 tests: queryState(Throttled);return queryState(Throttled);Executed by:
executed 7 times by 2 tests: return queryState(Throttled);Executed by:
| 7 | ||||||||||||||||||
| 140 | } | - | ||||||||||||||||||
| 141 | - | |||||||||||||||||||
| 142 | bool QFutureInterfaceBase::isResultReadyAt(int index) const | - | ||||||||||||||||||
| 143 | { | - | ||||||||||||||||||
| 144 | QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 145 | return executed 15004 times by 2 tests: d->internal_isResultReadyAt(index);return d->internal_isResultReadyAt(index);Executed by:
executed 15004 times by 2 tests: return d->internal_isResultReadyAt(index);Executed by:
| 15004 | ||||||||||||||||||
| 146 | } | - | ||||||||||||||||||
| 147 | - | |||||||||||||||||||
| 148 | bool QFutureInterfaceBase::waitForNextResult() | - | ||||||||||||||||||
| 149 | { | - | ||||||||||||||||||
| 150 | QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 151 | return never executed: d->internal_waitForNextResult();return d->internal_waitForNextResult();never executed: return d->internal_waitForNextResult(); | 0 | ||||||||||||||||||
| 152 | } | - | ||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | void QFutureInterfaceBase::waitForResume() | - | ||||||||||||||||||
| 155 | { | - | ||||||||||||||||||
| 156 | - | |||||||||||||||||||
| 157 | { | - | ||||||||||||||||||
| 158 | const int state = d->state.load(); | - | ||||||||||||||||||
| 159 | if (!(state & Paused)
| 0-6309 | ||||||||||||||||||
| 160 | return; executed 6309 times by 4 tests: return;Executed by:
| 6309 | ||||||||||||||||||
| 161 | } | - | ||||||||||||||||||
| 162 | - | |||||||||||||||||||
| 163 | QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 164 | const int state = d->state.load(); | - | ||||||||||||||||||
| 165 | if (!(state & Paused)
| 0 | ||||||||||||||||||
| 166 | return; never executed: return; | 0 | ||||||||||||||||||
| 167 | - | |||||||||||||||||||
| 168 | - | |||||||||||||||||||
| 169 | const ThreadPoolThreadReleaser releaser(d->pool()); | - | ||||||||||||||||||
| 170 | - | |||||||||||||||||||
| 171 | d->pausedWaitCondition.wait(&d->m_mutex); | - | ||||||||||||||||||
| 172 | } never executed: end of block | 0 | ||||||||||||||||||
| 173 | - | |||||||||||||||||||
| 174 | int QFutureInterfaceBase::progressValue() const | - | ||||||||||||||||||
| 175 | { | - | ||||||||||||||||||
| 176 | const QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 177 | return executed 17 times by 2 tests: d->m_progressValue;return d->m_progressValue;Executed by:
executed 17 times by 2 tests: return d->m_progressValue;Executed by:
| 17 | ||||||||||||||||||
| 178 | } | - | ||||||||||||||||||
| 179 | - | |||||||||||||||||||
| 180 | int QFutureInterfaceBase::progressMinimum() const | - | ||||||||||||||||||
| 181 | { | - | ||||||||||||||||||
| 182 | const QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 183 | return executed 12 times by 1 test: d->m_progressMinimum;return d->m_progressMinimum;Executed by:
executed 12 times by 1 test: return d->m_progressMinimum;Executed by:
| 12 | ||||||||||||||||||
| 184 | } | - | ||||||||||||||||||
| 185 | - | |||||||||||||||||||
| 186 | int QFutureInterfaceBase::progressMaximum() const | - | ||||||||||||||||||
| 187 | { | - | ||||||||||||||||||
| 188 | const QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 189 | return executed 12 times by 1 test: d->m_progressMaximum;return d->m_progressMaximum;Executed by:
executed 12 times by 1 test: return d->m_progressMaximum;Executed by:
| 12 | ||||||||||||||||||
| 190 | } | - | ||||||||||||||||||
| 191 | - | |||||||||||||||||||
| 192 | int QFutureInterfaceBase::resultCount() const | - | ||||||||||||||||||
| 193 | { | - | ||||||||||||||||||
| 194 | QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 195 | return executed 28711 times by 3 tests: d->internal_resultCount();return d->internal_resultCount();Executed by:
executed 28711 times by 3 tests: return d->internal_resultCount();Executed by:
| 28711 | ||||||||||||||||||
| 196 | } | - | ||||||||||||||||||
| 197 | - | |||||||||||||||||||
| 198 | QString QFutureInterfaceBase::progressText() const | - | ||||||||||||||||||
| 199 | { | - | ||||||||||||||||||
| 200 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 201 | return executed 15 times by 2 tests: d->m_progressText;return d->m_progressText;Executed by:
executed 15 times by 2 tests: return d->m_progressText;Executed by:
| 15 | ||||||||||||||||||
| 202 | } | - | ||||||||||||||||||
| 203 | - | |||||||||||||||||||
| 204 | bool QFutureInterfaceBase::isProgressUpdateNeeded() const | - | ||||||||||||||||||
| 205 | { | - | ||||||||||||||||||
| 206 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 207 | return executed 107 times by 1 test: !d->progressTime.isValid() || (d->progressTime.elapsed() > (1000 / MaxProgressEmitsPerSecond));return !d->progressTime.isValid() || (d->progressTime.elapsed() > (1000 / MaxProgressEmitsPerSecond));Executed by:
executed 107 times by 1 test: return !d->progressTime.isValid() || (d->progressTime.elapsed() > (1000 / MaxProgressEmitsPerSecond));Executed by:
| 107 | ||||||||||||||||||
| 208 | } | - | ||||||||||||||||||
| 209 | - | |||||||||||||||||||
| 210 | void QFutureInterfaceBase::reportStarted() | - | ||||||||||||||||||
| 211 | { | - | ||||||||||||||||||
| 212 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 213 | if (d->state.load() & (Started|Canceled|Finished)
| 0-128329 | ||||||||||||||||||
| 214 | return; never executed: return; | 0 | ||||||||||||||||||
| 215 | - | |||||||||||||||||||
| 216 | d->setState(State(Started | Running)); | - | ||||||||||||||||||
| 217 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Started)); | - | ||||||||||||||||||
| 218 | } executed 128329 times by 11 tests: end of blockExecuted by:
| 128329 | ||||||||||||||||||
| 219 | - | |||||||||||||||||||
| 220 | void QFutureInterfaceBase::reportCanceled() | - | ||||||||||||||||||
| 221 | { | - | ||||||||||||||||||
| 222 | cancel(); | - | ||||||||||||||||||
| 223 | } executed 3 times by 1 test: end of blockExecuted by:
| 3 | ||||||||||||||||||
| 224 | - | |||||||||||||||||||
| 225 | - | |||||||||||||||||||
| 226 | void QFutureInterfaceBase::reportException(const QException &exception) | - | ||||||||||||||||||
| 227 | { | - | ||||||||||||||||||
| 228 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 229 | if (d->state.load() & (Canceled|Finished)
| 0-17 | ||||||||||||||||||
| 230 | return; never executed: return; | 0 | ||||||||||||||||||
| 231 | - | |||||||||||||||||||
| 232 | d->m_exceptionStore.setException(exception); | - | ||||||||||||||||||
| 233 | switch_on(d->state, Canceled); | - | ||||||||||||||||||
| 234 | d->waitCondition.wakeAll(); | - | ||||||||||||||||||
| 235 | d->pausedWaitCondition.wakeAll(); | - | ||||||||||||||||||
| 236 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Canceled)); | - | ||||||||||||||||||
| 237 | } executed 17 times by 4 tests: end of blockExecuted by:
| 17 | ||||||||||||||||||
| 238 | - | |||||||||||||||||||
| 239 | - | |||||||||||||||||||
| 240 | void QFutureInterfaceBase::reportFinished() | - | ||||||||||||||||||
| 241 | { | - | ||||||||||||||||||
| 242 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 243 | if (!isFinished()
| 0-128328 | ||||||||||||||||||
| 244 | switch_from_to(d->state, Running, Finished); | - | ||||||||||||||||||
| 245 | d->waitCondition.wakeAll(); | - | ||||||||||||||||||
| 246 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Finished)); | - | ||||||||||||||||||
| 247 | } executed 128328 times by 11 tests: end of blockExecuted by:
| 128328 | ||||||||||||||||||
| 248 | } executed 128328 times by 11 tests: end of blockExecuted by:
| 128328 | ||||||||||||||||||
| 249 | - | |||||||||||||||||||
| 250 | void QFutureInterfaceBase::setExpectedResultCount(int resultCount) | - | ||||||||||||||||||
| 251 | { | - | ||||||||||||||||||
| 252 | if (d->manualProgress == false
| 0 | ||||||||||||||||||
| 253 | setProgressRange(0, resultCount); never executed: setProgressRange(0, resultCount); | 0 | ||||||||||||||||||
| 254 | d->m_expectedResultCount = resultCount; | - | ||||||||||||||||||
| 255 | } never executed: end of block | 0 | ||||||||||||||||||
| 256 | - | |||||||||||||||||||
| 257 | int QFutureInterfaceBase::expectedResultCount() | - | ||||||||||||||||||
| 258 | { | - | ||||||||||||||||||
| 259 | return never executed: d->m_expectedResultCount;return d->m_expectedResultCount;never executed: return d->m_expectedResultCount; | 0 | ||||||||||||||||||
| 260 | } | - | ||||||||||||||||||
| 261 | - | |||||||||||||||||||
| 262 | bool QFutureInterfaceBase::queryState(State state) const | - | ||||||||||||||||||
| 263 | { | - | ||||||||||||||||||
| 264 | return executed 737258 times by 12 tests: d->state.load() & state;return d->state.load() & state;Executed by:
executed 737258 times by 12 tests: return d->state.load() & state;Executed by:
| 737258 | ||||||||||||||||||
| 265 | } | - | ||||||||||||||||||
| 266 | - | |||||||||||||||||||
| 267 | void QFutureInterfaceBase::waitForResult(int resultIndex) | - | ||||||||||||||||||
| 268 | { | - | ||||||||||||||||||
| 269 | d->m_exceptionStore.throwPossibleException(); | - | ||||||||||||||||||
| 270 | - | |||||||||||||||||||
| 271 | QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 272 | if (!isRunning()
| 15527-60802 | ||||||||||||||||||
| 273 | return; executed 15527 times by 7 tests: return;Executed by:
| 15527 | ||||||||||||||||||
| 274 | lock.unlock(); | - | ||||||||||||||||||
| 275 | - | |||||||||||||||||||
| 276 | - | |||||||||||||||||||
| 277 | - | |||||||||||||||||||
| 278 | d->pool()->d_func()->stealAndRunRunnable(d->runnable); | - | ||||||||||||||||||
| 279 | - | |||||||||||||||||||
| 280 | lock.relock(); | - | ||||||||||||||||||
| 281 | - | |||||||||||||||||||
| 282 | const int waitIndex = (
| 86-60716 | ||||||||||||||||||
| 283 | while (isRunning()
| 473-32891 | ||||||||||||||||||
| 284 | d->waitCondition.wait(&d->m_mutex); executed 473 times by 6 tests: d->waitCondition.wait(&d->m_mutex);Executed by:
| 473 | ||||||||||||||||||
| 285 | - | |||||||||||||||||||
| 286 | d->m_exceptionStore.throwPossibleException(); | - | ||||||||||||||||||
| 287 | } executed 60800 times by 7 tests: end of blockExecuted by:
| 60800 | ||||||||||||||||||
| 288 | - | |||||||||||||||||||
| 289 | void QFutureInterfaceBase::waitForFinished() | - | ||||||||||||||||||
| 290 | { | - | ||||||||||||||||||
| 291 | QMutexLocker lock(&d->m_mutex); | - | ||||||||||||||||||
| 292 | const bool alreadyFinished = !isRunning(); | - | ||||||||||||||||||
| 293 | lock.unlock(); | - | ||||||||||||||||||
| 294 | - | |||||||||||||||||||
| 295 | if (!alreadyFinished
| 4253-71411 | ||||||||||||||||||
| 296 | d->pool()->d_func()->stealAndRunRunnable(d->runnable); | - | ||||||||||||||||||
| 297 | - | |||||||||||||||||||
| 298 | lock.relock(); | - | ||||||||||||||||||
| 299 | - | |||||||||||||||||||
| 300 | while (isRunning()
| 38070-71411 | ||||||||||||||||||
| 301 | d->waitCondition.wait(&d->m_mutex); executed 38070 times by 9 tests: d->waitCondition.wait(&d->m_mutex);Executed by:
| 38070 | ||||||||||||||||||
| 302 | } executed 71411 times by 9 tests: end of blockExecuted by:
| 71411 | ||||||||||||||||||
| 303 | - | |||||||||||||||||||
| 304 | d->m_exceptionStore.throwPossibleException(); | - | ||||||||||||||||||
| 305 | } executed 75653 times by 11 tests: end of blockExecuted by:
| 75653 | ||||||||||||||||||
| 306 | - | |||||||||||||||||||
| 307 | void QFutureInterfaceBase::reportResultsReady(int beginIndex, int endIndex) | - | ||||||||||||||||||
| 308 | { | - | ||||||||||||||||||
| 309 | if (beginIndex == endIndex
| 0-34826 | ||||||||||||||||||
| 310 | return; executed 53 times by 2 tests: return;Executed by:
| 53 | ||||||||||||||||||
| 311 | - | |||||||||||||||||||
| 312 | d->waitCondition.wakeAll(); | - | ||||||||||||||||||
| 313 | - | |||||||||||||||||||
| 314 | if (d->manualProgress == false
| 712-34114 | ||||||||||||||||||
| 315 | if (d->internal_updateProgress(d->m_progressValue + endIndex - beginIndex) == false
| 1119-32995 | ||||||||||||||||||
| 316 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady, | - | ||||||||||||||||||
| 317 | beginIndex, | - | ||||||||||||||||||
| 318 | endIndex)); | - | ||||||||||||||||||
| 319 | return; executed 1119 times by 5 tests: return;Executed by:
| 1119 | ||||||||||||||||||
| 320 | } | - | ||||||||||||||||||
| 321 | - | |||||||||||||||||||
| 322 | d->sendCallOuts(QFutureCallOutEvent(QFutureCallOutEvent::Progress, | - | ||||||||||||||||||
| 323 | d->m_progressValue, | - | ||||||||||||||||||
| 324 | d->m_progressText), | - | ||||||||||||||||||
| 325 | QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady, | - | ||||||||||||||||||
| 326 | beginIndex, | - | ||||||||||||||||||
| 327 | endIndex)); | - | ||||||||||||||||||
| 328 | return; executed 32995 times by 8 tests: return;Executed by:
| 32995 | ||||||||||||||||||
| 329 | } | - | ||||||||||||||||||
| 330 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady, beginIndex, endIndex)); | - | ||||||||||||||||||
| 331 | } executed 712 times by 4 tests: end of blockExecuted by:
| 712 | ||||||||||||||||||
| 332 | - | |||||||||||||||||||
| 333 | void QFutureInterfaceBase::setRunnable(QRunnable *runnable) | - | ||||||||||||||||||
| 334 | { | - | ||||||||||||||||||
| 335 | d->runnable = runnable; | - | ||||||||||||||||||
| 336 | } executed 67765 times by 7 tests: end of blockExecuted by:
| 67765 | ||||||||||||||||||
| 337 | - | |||||||||||||||||||
| 338 | void QFutureInterfaceBase::setThreadPool(QThreadPool *pool) | - | ||||||||||||||||||
| 339 | { | - | ||||||||||||||||||
| 340 | d->m_pool = pool; | - | ||||||||||||||||||
| 341 | } executed 67765 times by 7 tests: end of blockExecuted by:
| 67765 | ||||||||||||||||||
| 342 | - | |||||||||||||||||||
| 343 | void QFutureInterfaceBase::setFilterMode(bool enable) | - | ||||||||||||||||||
| 344 | { | - | ||||||||||||||||||
| 345 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 346 | resultStoreBase().setFilterMode(enable); | - | ||||||||||||||||||
| 347 | } executed 34 times by 2 tests: end of blockExecuted by:
| 34 | ||||||||||||||||||
| 348 | - | |||||||||||||||||||
| 349 | void QFutureInterfaceBase::setProgressRange(int minimum, int maximum) | - | ||||||||||||||||||
| 350 | { | - | ||||||||||||||||||
| 351 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 352 | d->m_progressMinimum = minimum; | - | ||||||||||||||||||
| 353 | d->m_progressMaximum = maximum; | - | ||||||||||||||||||
| 354 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::ProgressRange, minimum, maximum)); | - | ||||||||||||||||||
| 355 | } executed 260 times by 4 tests: end of blockExecuted by:
| 260 | ||||||||||||||||||
| 356 | - | |||||||||||||||||||
| 357 | void QFutureInterfaceBase::setProgressValue(int progressValue) | - | ||||||||||||||||||
| 358 | { | - | ||||||||||||||||||
| 359 | setProgressValueAndText(progressValue, QString()); | - | ||||||||||||||||||
| 360 | } executed 105907 times by 5 tests: end of blockExecuted by:
| 105907 | ||||||||||||||||||
| 361 | - | |||||||||||||||||||
| 362 | void QFutureInterfaceBase::setProgressValueAndText(int progressValue, | - | ||||||||||||||||||
| 363 | const QString &progressText) | - | ||||||||||||||||||
| 364 | { | - | ||||||||||||||||||
| 365 | QMutexLocker locker(&d->m_mutex); | - | ||||||||||||||||||
| 366 | if (d->manualProgress == false
| 261-105651 | ||||||||||||||||||
| 367 | d->manualProgress = true; executed 261 times by 5 tests: d->manualProgress = true;Executed by:
| 261 | ||||||||||||||||||
| 368 | if (d->m_progressValue >= progressValue
| 48-105864 | ||||||||||||||||||
| 369 | return; executed 48 times by 4 tests: return;Executed by:
| 48 | ||||||||||||||||||
| 370 | - | |||||||||||||||||||
| 371 | if (d->state.load() & (Canceled|Finished)
| 0-105864 | ||||||||||||||||||
| 372 | return; never executed: return; | 0 | ||||||||||||||||||
| 373 | - | |||||||||||||||||||
| 374 | if (d->internal_updateProgress(progressValue, progressText)
| 524-105340 | ||||||||||||||||||
| 375 | d->sendCallOut(QFutureCallOutEvent(QFutureCallOutEvent::Progress, | - | ||||||||||||||||||
| 376 | d->m_progressValue, | - | ||||||||||||||||||
| 377 | d->m_progressText)); | - | ||||||||||||||||||
| 378 | } executed 524 times by 5 tests: end of blockExecuted by:
| 524 | ||||||||||||||||||
| 379 | } executed 105864 times by 5 tests: end of blockExecuted by:
| 105864 | ||||||||||||||||||
| 380 | - | |||||||||||||||||||
| 381 | QMutex *QFutureInterfaceBase::mutex() const | - | ||||||||||||||||||
| 382 | { | - | ||||||||||||||||||
| 383 | return executed 111280 times by 8 tests: &d->m_mutex;return &d->m_mutex;Executed by:
executed 111280 times by 8 tests: return &d->m_mutex;Executed by:
| 111280 | ||||||||||||||||||
| 384 | } | - | ||||||||||||||||||
| 385 | - | |||||||||||||||||||
| 386 | QtPrivate::ExceptionStore &QFutureInterfaceBase::exceptionStore() | - | ||||||||||||||||||
| 387 | { | - | ||||||||||||||||||
| 388 | return executed 3 times by 1 test: d->m_exceptionStore;return d->m_exceptionStore;Executed by:
executed 3 times by 1 test: return d->m_exceptionStore;Executed by:
| 3 | ||||||||||||||||||
| 389 | } | - | ||||||||||||||||||
| 390 | - | |||||||||||||||||||
| 391 | QtPrivate::ResultStoreBase &QFutureInterfaceBase::resultStoreBase() | - | ||||||||||||||||||
| 392 | { | - | ||||||||||||||||||
| 393 | return executed 68791 times by 9 tests: d->m_results;return d->m_results;Executed by:
executed 68791 times by 9 tests: return d->m_results;Executed by:
| 68791 | ||||||||||||||||||
| 394 | } | - | ||||||||||||||||||
| 395 | - | |||||||||||||||||||
| 396 | const QtPrivate::ResultStoreBase &QFutureInterfaceBase::resultStoreBase() const | - | ||||||||||||||||||
| 397 | { | - | ||||||||||||||||||
| 398 | return executed 76299 times by 8 tests: d->m_results;return d->m_results;Executed by:
executed 76299 times by 8 tests: return d->m_results;Executed by:
| 76299 | ||||||||||||||||||
| 399 | } | - | ||||||||||||||||||
| 400 | - | |||||||||||||||||||
| 401 | QFutureInterfaceBase &QFutureInterfaceBase::operator=(const QFutureInterfaceBase &other) | - | ||||||||||||||||||
| 402 | { | - | ||||||||||||||||||
| 403 | other.d->refCount.ref(); | - | ||||||||||||||||||
| 404 | if (!d->refCount.deref()
| 26-74 | ||||||||||||||||||
| 405 | delete d; executed 74 times by 4 tests: delete d;Executed by:
| 74 | ||||||||||||||||||
| 406 | d = other.d; | - | ||||||||||||||||||
| 407 | return executed 100 times by 4 tests: *this;return *this;Executed by:
executed 100 times by 4 tests: return *this;Executed by:
| 100 | ||||||||||||||||||
| 408 | } | - | ||||||||||||||||||
| 409 | - | |||||||||||||||||||
| 410 | bool QFutureInterfaceBase::refT() const | - | ||||||||||||||||||
| 411 | { | - | ||||||||||||||||||
| 412 | return executed 96297 times by 8 tests: d->refCount.refT();return d->refCount.refT();Executed by:
executed 96297 times by 8 tests: return d->refCount.refT();Executed by:
| 96297 | ||||||||||||||||||
| 413 | } | - | ||||||||||||||||||
| 414 | - | |||||||||||||||||||
| 415 | bool QFutureInterfaceBase::derefT() const | - | ||||||||||||||||||
| 416 | { | - | ||||||||||||||||||
| 417 | return executed 96297 times by 9 tests: d->refCount.derefT();return d->refCount.derefT();Executed by:
executed 96297 times by 9 tests: return d->refCount.derefT();Executed by:
| 96297 | ||||||||||||||||||
| 418 | } | - | ||||||||||||||||||
| 419 | - | |||||||||||||||||||
| 420 | QFutureInterfaceBasePrivate::QFutureInterfaceBasePrivate(QFutureInterfaceBase::State initialState) | - | ||||||||||||||||||
| 421 | : refCount(1), m_progressValue(0), m_progressMinimum(0), m_progressMaximum(0), | - | ||||||||||||||||||
| 422 | state(initialState), | - | ||||||||||||||||||
| 423 | manualProgress(false), m_expectedResultCount(0), runnable(0), m_pool(0) | - | ||||||||||||||||||
| 424 | { | - | ||||||||||||||||||
| 425 | progressTime.invalidate(); | - | ||||||||||||||||||
| 426 | } executed 128690 times by 12 tests: end of blockExecuted by:
| 128690 | ||||||||||||||||||
| 427 | - | |||||||||||||||||||
| 428 | int QFutureInterfaceBasePrivate::internal_resultCount() const | - | ||||||||||||||||||
| 429 | { | - | ||||||||||||||||||
| 430 | return executed 28711 times by 3 tests: m_results.count();return m_results.count();Executed by:
executed 28711 times by 3 tests: return m_results.count();Executed by:
| 28711 | ||||||||||||||||||
| 431 | } | - | ||||||||||||||||||
| 432 | - | |||||||||||||||||||
| 433 | bool QFutureInterfaceBasePrivate::internal_isResultReadyAt(int index) const | - | ||||||||||||||||||
| 434 | { | - | ||||||||||||||||||
| 435 | return executed 43388 times by 8 tests: (m_results.contains(index));return (m_results.contains(index));Executed by:
executed 43388 times by 8 tests: return (m_results.contains(index));Executed by:
| 43388 | ||||||||||||||||||
| 436 | } | - | ||||||||||||||||||
| 437 | - | |||||||||||||||||||
| 438 | bool QFutureInterfaceBasePrivate::internal_waitForNextResult() | - | ||||||||||||||||||
| 439 | { | - | ||||||||||||||||||
| 440 | if (m_results.hasNextResult()
| 0 | ||||||||||||||||||
| 441 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 442 | - | |||||||||||||||||||
| 443 | while ((
| 0 | ||||||||||||||||||
| 444 | waitCondition.wait(&m_mutex); never executed: waitCondition.wait(&m_mutex); | 0 | ||||||||||||||||||
| 445 | - | |||||||||||||||||||
| 446 | return never executed: !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();return !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult();never executed: return !(state.load() & QFutureInterfaceBase::Canceled) && m_results.hasNextResult(); | 0 | ||||||||||||||||||
| 447 | } | - | ||||||||||||||||||
| 448 | - | |||||||||||||||||||
| 449 | bool QFutureInterfaceBasePrivate::internal_updateProgress(int progress, | - | ||||||||||||||||||
| 450 | const QString &progressText) | - | ||||||||||||||||||
| 451 | { | - | ||||||||||||||||||
| 452 | if (m_progressValue >= progress
| 0-139978 | ||||||||||||||||||
| 453 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 454 | - | |||||||||||||||||||
| 455 | m_progressValue = progress; | - | ||||||||||||||||||
| 456 | m_progressText = progressText; | - | ||||||||||||||||||
| 457 | - | |||||||||||||||||||
| 458 | if (progressTime.isValid()
| 247-106769 | ||||||||||||||||||
| 459 | if (progressTime.elapsed() < (1000 / MaxProgressEmitsPerSecond)
| 63-106459 | ||||||||||||||||||
| 460 | return executed 106459 times by 6 tests: false;return false;Executed by:
executed 106459 times by 6 tests: return false;Executed by:
| 106459 | ||||||||||||||||||
| 461 | - | |||||||||||||||||||
| 462 | progressTime.start(); | - | ||||||||||||||||||
| 463 | return executed 33519 times by 8 tests: true;return true;Executed by:
executed 33519 times by 8 tests: return true;Executed by:
| 33519 | ||||||||||||||||||
| 464 | } | - | ||||||||||||||||||
| 465 | - | |||||||||||||||||||
| 466 | void QFutureInterfaceBasePrivate::internal_setThrottled(bool enable) | - | ||||||||||||||||||
| 467 | { | - | ||||||||||||||||||
| 468 | - | |||||||||||||||||||
| 469 | if ((enable
| 0-1164 | ||||||||||||||||||
| 470 | || (!enable
| 0-3 | ||||||||||||||||||
| 471 | return; executed 1161 times by 1 test: return;Executed by:
| 1161 | ||||||||||||||||||
| 472 | - | |||||||||||||||||||
| 473 | - | |||||||||||||||||||
| 474 | if (enable
| 0-3 | ||||||||||||||||||
| 475 | switch_on(state, QFutureInterfaceBase::Throttled); | - | ||||||||||||||||||
| 476 | } executed 3 times by 1 test: else {end of blockExecuted by:
| 3 | ||||||||||||||||||
| 477 | switch_off(state, QFutureInterfaceBase::Throttled); | - | ||||||||||||||||||
| 478 | if (!(state.load() & QFutureInterfaceBase::Paused)
| 0 | ||||||||||||||||||
| 479 | pausedWaitCondition.wakeAll(); never executed: pausedWaitCondition.wakeAll(); | 0 | ||||||||||||||||||
| 480 | } never executed: end of block | 0 | ||||||||||||||||||
| 481 | } | - | ||||||||||||||||||
| 482 | - | |||||||||||||||||||
| 483 | void QFutureInterfaceBasePrivate::sendCallOut(const QFutureCallOutEvent &callOutEvent) | - | ||||||||||||||||||
| 484 | { | - | ||||||||||||||||||
| 485 | if (outputConnections.isEmpty()
| 1053-259374 | ||||||||||||||||||
| 486 | return; executed 259374 times by 11 tests: return;Executed by:
| 259374 | ||||||||||||||||||
| 487 | - | |||||||||||||||||||
| 488 | for (int i = 0; i < outputConnections.count()
| 1053 | ||||||||||||||||||
| 489 | outputConnections.at(i)->postCallOutEvent(callOutEvent); executed 1053 times by 1 test: outputConnections.at(i)->postCallOutEvent(callOutEvent);Executed by:
| 1053 | ||||||||||||||||||
| 490 | } executed 1053 times by 1 test: end of blockExecuted by:
| 1053 | ||||||||||||||||||
| 491 | - | |||||||||||||||||||
| 492 | void QFutureInterfaceBasePrivate::sendCallOuts(const QFutureCallOutEvent &callOutEvent1, | - | ||||||||||||||||||
| 493 | const QFutureCallOutEvent &callOutEvent2) | - | ||||||||||||||||||
| 494 | { | - | ||||||||||||||||||
| 495 | if (outputConnections.isEmpty()
| 6-32989 | ||||||||||||||||||
| 496 | return; executed 32989 times by 8 tests: return;Executed by:
| 32989 | ||||||||||||||||||
| 497 | - | |||||||||||||||||||
| 498 | for (int i = 0; i < outputConnections.count()
| 6 | ||||||||||||||||||
| 499 | QFutureCallOutInterface *interface = outputConnections.at(i); | - | ||||||||||||||||||
| 500 | interface->postCallOutEvent(callOutEvent1); | - | ||||||||||||||||||
| 501 | interface->postCallOutEvent(callOutEvent2); | - | ||||||||||||||||||
| 502 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||
| 503 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||
| 504 | - | |||||||||||||||||||
| 505 | - | |||||||||||||||||||
| 506 | - | |||||||||||||||||||
| 507 | - | |||||||||||||||||||
| 508 | - | |||||||||||||||||||
| 509 | void QFutureInterfaceBasePrivate::connectOutputInterface(QFutureCallOutInterface *interface) | - | ||||||||||||||||||
| 510 | { | - | ||||||||||||||||||
| 511 | QMutexLocker locker(&m_mutex); | - | ||||||||||||||||||
| 512 | - | |||||||||||||||||||
| 513 | if (state.load() & QFutureInterfaceBase::Started
| 0-28 | ||||||||||||||||||
| 514 | interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Started)); | - | ||||||||||||||||||
| 515 | interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::ProgressRange, | - | ||||||||||||||||||
| 516 | m_progressMinimum, | - | ||||||||||||||||||
| 517 | m_progressMaximum)); | - | ||||||||||||||||||
| 518 | interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Progress, | - | ||||||||||||||||||
| 519 | m_progressValue, | - | ||||||||||||||||||
| 520 | m_progressText)); | - | ||||||||||||||||||
| 521 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||
| 522 | - | |||||||||||||||||||
| 523 | QtPrivate::ResultIteratorBase it = m_results.begin(); | - | ||||||||||||||||||
| 524 | while (it != m_results.end()
| 28-177 | ||||||||||||||||||
| 525 | const int begin = it.resultIndex(); | - | ||||||||||||||||||
| 526 | const int end = begin + it.batchSize(); | - | ||||||||||||||||||
| 527 | interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::ResultsReady, | - | ||||||||||||||||||
| 528 | begin, | - | ||||||||||||||||||
| 529 | end)); | - | ||||||||||||||||||
| 530 | it.batchedAdvance(); | - | ||||||||||||||||||
| 531 | } executed 177 times by 1 test: end of blockExecuted by:
| 177 | ||||||||||||||||||
| 532 | - | |||||||||||||||||||
| 533 | if (state.load() & QFutureInterfaceBase::Paused
| 0-28 | ||||||||||||||||||
| 534 | interface-> never executed: postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused));never executed: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Paused)); | 0 | ||||||||||||||||||
| 535 | - | |||||||||||||||||||
| 536 | if (state.load() & QFutureInterfaceBase::Canceled
| 5-23 | ||||||||||||||||||
| 537 | interface-> executed 5 times by 1 test: postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));Executed by:
executed 5 times by 1 test: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Canceled));Executed by:
| 5 | ||||||||||||||||||
| 538 | - | |||||||||||||||||||
| 539 | if (state.load() & QFutureInterfaceBase::Finished
| 14 | ||||||||||||||||||
| 540 | interface-> executed 14 times by 1 test: postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));Executed by:
executed 14 times by 1 test: interface->postCallOutEvent(QFutureCallOutEvent(QFutureCallOutEvent::Finished));Executed by:
| 14 | ||||||||||||||||||
| 541 | - | |||||||||||||||||||
| 542 | outputConnections.append(interface); | - | ||||||||||||||||||
| 543 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||
| 544 | - | |||||||||||||||||||
| 545 | void QFutureInterfaceBasePrivate::disconnectOutputInterface(QFutureCallOutInterface *interface) | - | ||||||||||||||||||
| 546 | { | - | ||||||||||||||||||
| 547 | QMutexLocker lock(&m_mutex); | - | ||||||||||||||||||
| 548 | const int index = outputConnections.indexOf(interface); | - | ||||||||||||||||||
| 549 | if (index == -1
| 23-28 | ||||||||||||||||||
| 550 | return; executed 23 times by 1 test: return;Executed by:
| 23 | ||||||||||||||||||
| 551 | outputConnections.removeAt(index); | - | ||||||||||||||||||
| 552 | - | |||||||||||||||||||
| 553 | interface->callOutInterfaceDisconnected(); | - | ||||||||||||||||||
| 554 | } executed 28 times by 1 test: end of blockExecuted by:
| 28 | ||||||||||||||||||
| 555 | - | |||||||||||||||||||
| 556 | void QFutureInterfaceBasePrivate::setState(QFutureInterfaceBase::State newState) | - | ||||||||||||||||||
| 557 | { | - | ||||||||||||||||||
| 558 | state.store(newState); | - | ||||||||||||||||||
| 559 | } executed 128329 times by 11 tests: end of blockExecuted by:
| 128329 | ||||||||||||||||||
| 560 | - | |||||||||||||||||||
| 561 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |