Skip to content
Snippets Groups Projects
Commit a4140b00 authored by John Romein's avatar John Romein
Browse files

bug 225:

Do not reset while reader thread reads from BeamletBuffer.
parent 573e00b6
No related branches found
No related tags found
No related merge requests found
...@@ -167,6 +167,9 @@ void BeamletBuffer::resetCurrentTimeStamp(const TimeStamp &newTimeStamp) ...@@ -167,6 +167,9 @@ void BeamletBuffer::resetCurrentTimeStamp(const TimeStamp &newTimeStamp)
if (!aligned(itsCurrentI, itsNrTimesPerPacket)) { if (!aligned(itsCurrentI, itsNrTimesPerPacket)) {
// RSP board reset? Recompute itsOffset and clear the entire buffer. // RSP board reset? Recompute itsOffset and clear the entire buffer.
itsLockedRanges.lock(0, itsSize, itsSize); // avoid reset while other thread reads
itsOffset = - (itsCurrentI % itsNrTimesPerPacket); itsOffset = - (itsCurrentI % itsNrTimesPerPacket);
itsCurrentI = mapTime2Index(newTimeStamp); itsCurrentI = mapTime2Index(newTimeStamp);
...@@ -174,6 +177,8 @@ void BeamletBuffer::resetCurrentTimeStamp(const TimeStamp &newTimeStamp) ...@@ -174,6 +177,8 @@ void BeamletBuffer::resetCurrentTimeStamp(const TimeStamp &newTimeStamp)
itsValidData.reset(); itsValidData.reset();
pthread_mutex_unlock(&itsValidDataMutex); pthread_mutex_unlock(&itsValidDataMutex);
itsLockedRanges.unlock(0, itsSize, itsSize);
std::clog << "reset BeamletBuffer" << std::endl; std::clog << "reset BeamletBuffer" << std::endl;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment