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
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,10 @@ void Delays::mainLoop()
bufferUsed.up(itsNrCalcDelays);
}
} catch (AipsError &ex) {
// trigger getNextDelays and force it to stop
stop = true;
bufferUsed.up(1);
THROW(IONProcException, "AipsError: " << ex.what());
}
......@@ -210,8 +214,13 @@ void Delays::getNextDelays(Matrix<MVDirection> &directions, Matrix<double> &dela
ASSERTSTR(delays.num_elements() == itsNrBeams * (itsMaxNrPencilBeams + 1),
delays.num_elements() << " == " << itsNrBeams << "*" << (itsMaxNrPencilBeams + 1));
ASSERT(itsThread);
bufferUsed.down();
if (stop)
THROW(IONProcException, "Cannot obtain delays -- delay thread stopped running");
// copy the directions at itsBuffer[head] into the provided buffer,
// and calculate the respective delays
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