From d9261bdb05cd0863a2c3747c812871dbb851646e Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 14 Aug 2019 11:45:34 +0200 Subject: Replace signal-based abort handling by query-based handling The abort handling is currently only used to process Ctrl-C from Matlab. Since Matlab R2019a, it appears that calling utIsInterruptPending() from a thread other than the main thread will crash. The previous approach of checking utIsInterruptPending() in a thread, and then signalling the running algorithm was therefore broken. --- src/SartAlgorithm.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/SartAlgorithm.cpp') diff --git a/src/SartAlgorithm.cpp b/src/SartAlgorithm.cpp index 94460ba..7a3947d 100644 --- a/src/SartAlgorithm.cpp +++ b/src/SartAlgorithm.cpp @@ -288,8 +288,6 @@ void CSartAlgorithm::run(int _iNrIterations) // check initialized ASTRA_ASSERT(m_bIsInitialized); - m_bShouldAbort = false; - // data projectors CDataProjectorInterface* pFirstForwardProjector; CDataProjectorInterface* pForwardProjector; @@ -334,7 +332,7 @@ void CSartAlgorithm::run(int _iNrIterations) // iteration loop - for (int iIteration = 0; iIteration < _iNrIterations && !m_bShouldAbort; ++iIteration) { + for (int iIteration = 0; iIteration < _iNrIterations && !shouldAbort(); ++iIteration) { int iProjection = m_piProjectionOrder[m_iIterationCount % m_iProjectionCount]; -- cgit v1.2.3