MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / abortThreadedTask

Method abortThreadedTask

Engine/GenericSchedulerThread.cpp:327–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325}
326
327bool
328GenericSchedulerThread::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
362bool
363GenericSchedulerThread::isBeingAborted() const

Callers 8

handleBlockingTaskMethod · 0.80
abortTrackingMethod · 0.80
onAbortRequestedMethod · 0.80
stopTrackingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected