| 325 | } |
| 326 | |
| 327 | bool |
| 328 | GenericSchedulerThread::abortThreadedTask(bool keepOldestRender) |
| 329 | { |
| 330 | if ( !isRunning() ) { |
| 331 | return false; |
| 332 | } |
| 333 | |
| 334 | ThreadStateEnum state = getThreadState(); |
| 335 | bool shouldRequestAbort = state != eThreadStateAborted && state != eThreadStateIdle; |
| 336 | if ( keepOldestRender && !shouldRequestAbort ) { |
| 337 | return false; |
| 338 | } |
| 339 | |
| 340 | { |
| 341 | QMutexLocker l(&_imp->abortRequestedMutex); |
| 342 | |
| 343 | |
| 344 | // We are already aborting |
| 345 | if (_imp->abortRequested > 0 && keepOldestRender) { |
| 346 | return false; |
| 347 | } |
| 348 | |
| 349 | #ifdef TRACE_GENERIC_SCHEDULER_THREAD |
| 350 | qDebug() << QThread::currentThread() << ": Aborting task on" << getThreadName().c_str(); |
| 351 | #endif |
| 352 | if (shouldRequestAbort) { |
| 353 | ++_imp->abortRequested; |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | onAbortRequested(keepOldestRender); |
| 358 | |
| 359 | return true; |
| 360 | } |
| 361 | |
| 362 | bool |
| 363 | GenericSchedulerThread::isBeingAborted() const |
no outgoing calls
no test coverage detected