Skip to content

Commit

Permalink
Merge branch 'fix-tango-deadlock-in-prepareacq-during-lengthy-memory-…
Browse files Browse the repository at this point in the history
…allocations' into 'master'

Fix Tango dead-lock in prepareAcq during lengthy memory allocations

See merge request limagroup/lima!176
  • Loading branch information
claustre committed Jul 23, 2020
2 parents 411b357 + af12c34 commit 6449a97
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions control/src/CtControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,17 @@ void CtControl::prepareAcq()
if(aStatus.AcquisitionStatus == AcqConfig)
THROW_CTL_ERROR(Error) << "Configuration not finished";

m_ready= false; // prevent calling startAcq before full preparation
{
AutoMutex aLock(m_cond.mutex());
m_ready= false; // prevent calling startAcq before full preparation
}

//Abort previous acquisition tasks
PoolThreadMgr::get().abort();
m_ct_saving->_resetReadyFlag();

resetStatus(false);
// reset acq status without notifying callbacks
resetStatus(true);

//Clear all re-ordered image counters
m_images_ready.clear();
Expand Down Expand Up @@ -572,6 +576,9 @@ void CtControl::prepareAcq()
m_ct_video->isActive()))
THROW_CTL_ERROR(Error) << "Can't have any software operation if Hardware saving is active";

// reset status and notify callbacks
resetStatus(false);

AutoMutex aLock(m_cond.mutex());
m_ready= true;
}
Expand Down

0 comments on commit 6449a97

Please sign in to comment.