| 155 | } |
| 156 | |
| 157 | bool |
| 158 | AbortableRenderInfo::unregisterThreadForRender(AbortableThread* thread) |
| 159 | { |
| 160 | bool ret = false; |
| 161 | bool threadsEmpty = false; |
| 162 | { |
| 163 | QMutexLocker k(&_imp->threadsMutex); |
| 164 | ThreadSet::iterator found = _imp->threadsForThisRender.find(thread); |
| 165 | |
| 166 | if ( found != _imp->threadsForThisRender.end() ) { |
| 167 | _imp->threadsForThisRender.erase(found); |
| 168 | ret = true; |
| 169 | } |
| 170 | // Stop the timer if no more threads are running for this render |
| 171 | threadsEmpty = _imp->threadsForThisRender.empty(); |
| 172 | } |
| 173 | |
| 174 | if (threadsEmpty) { |
| 175 | { |
| 176 | QMutexLocker k(&_imp->timerMutex); |
| 177 | if (_imp->abortTimeoutTimer) { |
| 178 | _imp->timerStarted = false; |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | return ret; |
| 184 | } |
| 185 | |
| 186 | void |
| 187 | AbortableRenderInfo::onStartTimerInOriginalThreadTriggered() |
no test coverage detected