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

Method abortThreadedTask

Engine/GenericSchedulerThread.cpp:322–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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