| 148 | } |
| 149 | |
| 150 | void PDFPageProcessingThread::clearWorkStack() |
| 151 | { |
| 152 | _mutex.lock(); |
| 153 | |
| 154 | foreach(PageProcessingRequest * workItem, _workStack) { |
| 155 | if (!workItem) |
| 156 | continue; |
| 157 | Q_ASSERT(workItem->thread() == QCoreApplication::instance()->thread()); |
| 158 | workItem->deleteLater(); |
| 159 | } |
| 160 | _workStack.clear(); |
| 161 | |
| 162 | if (!_idle) { |
| 163 | // Wait until the current operation finishes |
| 164 | _idleCondition.wait(&_mutex); |
| 165 | } |
| 166 | _mutex.unlock(); |
| 167 | } |
| 168 | |
| 169 | |
| 170 | // Asynchronous Page Operations |
no test coverage detected