| 2629 | } |
| 2630 | |
| 2631 | void |
| 2632 | Node::quitAnyProcessing_blocking(bool allowThreadsToRestart) |
| 2633 | { |
| 2634 | { |
| 2635 | QMutexLocker k(&_imp->nodeIsDequeuingMutex); |
| 2636 | if (_imp->nodeIsDequeuing) { |
| 2637 | _imp->nodeIsDequeuing = false; |
| 2638 | |
| 2639 | //Attempt to wake-up sleeping threads of the thread pool |
| 2640 | _imp->nodeIsDequeuingCond.wakeAll(); |
| 2641 | } |
| 2642 | } |
| 2643 | |
| 2644 | |
| 2645 | //If this effect has a RenderEngine, make sure it is finished |
| 2646 | OutputEffectInstance* isOutput = dynamic_cast<OutputEffectInstance*>( _imp->effect.get() ); |
| 2647 | |
| 2648 | if (isOutput) { |
| 2649 | boost::shared_ptr<RenderEngine> engine = isOutput->getRenderEngine(); |
| 2650 | assert(engine); |
| 2651 | engine->quitEngine(allowThreadsToRestart); |
| 2652 | engine->waitForEngineToQuit_enforce_blocking(); |
| 2653 | } |
| 2654 | |
| 2655 | //Returns when the preview is done computign |
| 2656 | _imp->abortPreview_blocking(allowThreadsToRestart); |
| 2657 | |
| 2658 | boost::shared_ptr<TrackerContext> trackerContext = getTrackerContext(); |
| 2659 | if (trackerContext) { |
| 2660 | trackerContext->quitTrackerThread_blocking(allowThreadsToRestart); |
| 2661 | } |
| 2662 | |
| 2663 | if ( isRotoPaintingNode() ) { |
| 2664 | NodesList rotopaintNodes; |
| 2665 | getRotoContext()->getRotoPaintTreeNodes(&rotopaintNodes); |
| 2666 | for (NodesList::iterator it = rotopaintNodes.begin(); it != rotopaintNodes.end(); ++it) { |
| 2667 | (*it)->quitAnyProcessing_blocking(allowThreadsToRestart); |
| 2668 | } |
| 2669 | } |
| 2670 | } |
| 2671 | |
| 2672 | void |
| 2673 | Node::abortAnyProcessing_non_blocking() |
no test coverage detected