Commit fe0c54c3 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Removed a "incititation-to-dead-lock-method"

The call to this method have been removed to, thus probably improving
stability
parent 2ddc015a
......@@ -39,11 +39,6 @@ class WaitCondition
delete m_waitCond;
delete m_mutex;
}
void wait()
{
QMutexLocker lock( m_mutex );
m_waitCond->wait( m_mutex );
}
void waitLocked()
{
m_waitCond->wait( m_mutex );
......
......@@ -53,6 +53,7 @@ ClipWorkflow::~ClipWorkflow()
delete m_initWaitCond;
delete m_condMutex;
delete m_waitCond;
delete m_renderWaitCond;
delete m_requiredStateLock;
delete m_stateLock;
}
......@@ -281,7 +282,7 @@ void ClipWorkflow::unpause()
void ClipWorkflow::waitForCompleteRender( bool dontCheckRenderStarted /*= false*/ )
{
if ( isRendering() == true || dontCheckRenderStarted == true )
m_renderWaitCond->wait();
m_renderWaitCond->waitLocked();
}
void ClipWorkflow::waitForCompleteInit()
......@@ -321,3 +322,7 @@ void ClipWorkflow::setFullSpeedRender( bool value )
m_fullSpeedRender = value;
}
WaitCondition* ClipWorkflow::getRenderCondWait()
{
return m_renderWaitCond;
}
......@@ -148,6 +148,12 @@ class ClipWorkflow : public QObject
void unpause();
void waitForCompleteInit();
/**
* \brief Return the wait condition associated to the render.
* It's used when waiting for a render to terminate.
*/
WaitCondition* getRenderCondWait();
void waitForCompleteRender( bool dontCheckRenderStarted = false );
QMutex* getSleepMutex();
......
......@@ -133,7 +133,10 @@ void TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
//The rendering state meens... whell it means that the frame is
//beeing rendered, so we wait.
cw->getStateLock()->unlock();
cw->waitForCompleteRender();
{
QMutexLocker lock( cw->getRenderCondWait()->getMutex() );
cw->waitForCompleteRender();
}
//This way we can trigger the appropriate if just below.
//by restoring the initial state of the function, and just pretend that
//nothing happened.
......@@ -234,7 +237,10 @@ void TrackWorkflow::stopClipWorkflow( ClipWorkflow* cw )
else if ( cw->getState() == ClipWorkflow::Rendering )
{
cw->getStateLock()->unlock();
cw->waitForCompleteRender();
{
QMutexLocker lock( cw->getRenderCondWait()->getMutex() );
cw->waitForCompleteRender();
}
{
QMutexLocker lock( cw->getSleepMutex() );
cw->queryStateChange( ClipWorkflow::Stopping );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment