Skip to content
Snippets Groups Projects
Commit 157f6a30 authored by Jan David Mol's avatar Jan David Mol
Browse files

Task #2669: Fail instead of freeze if the Delay thread terminates prematurely

parent 95e9c0cd
Branches
Tags
No related merge requests found
...@@ -195,6 +195,10 @@ void Delays::mainLoop() ...@@ -195,6 +195,10 @@ void Delays::mainLoop()
bufferUsed.up(itsNrCalcDelays); bufferUsed.up(itsNrCalcDelays);
} }
} catch (AipsError &ex) { } catch (AipsError &ex) {
// trigger getNextDelays and force it to stop
stop = true;
bufferUsed.up(1);
THROW(IONProcException, "AipsError: " << ex.what()); THROW(IONProcException, "AipsError: " << ex.what());
} }
...@@ -210,8 +214,13 @@ void Delays::getNextDelays(Matrix<MVDirection> &directions, Matrix<double> &dela ...@@ -210,8 +214,13 @@ void Delays::getNextDelays(Matrix<MVDirection> &directions, Matrix<double> &dela
ASSERTSTR(delays.num_elements() == itsNrBeams * (itsMaxNrPencilBeams + 1), ASSERTSTR(delays.num_elements() == itsNrBeams * (itsMaxNrPencilBeams + 1),
delays.num_elements() << " == " << itsNrBeams << "*" << (itsMaxNrPencilBeams + 1)); delays.num_elements() << " == " << itsNrBeams << "*" << (itsMaxNrPencilBeams + 1));
ASSERT(itsThread);
bufferUsed.down(); bufferUsed.down();
if (stop)
THROW(IONProcException, "Cannot obtain delays -- delay thread stopped running");
// copy the directions at itsBuffer[head] into the provided buffer, // copy the directions at itsBuffer[head] into the provided buffer,
// and calculate the respective delays // and calculate the respective delays
for (unsigned b = 0; b < itsNrBeams; b ++) { for (unsigned b = 0; b < itsNrBeams; b ++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment