diff --git a/Appl/CEP/CS1/CS1_IONProc/src/BeamletBuffer.cc b/Appl/CEP/CS1/CS1_IONProc/src/BeamletBuffer.cc index 5f2728714054143028469fca467b1e853157be14..51cebd8ca2bf66e482321e66696d27558e58970c 100644 --- a/Appl/CEP/CS1/CS1_IONProc/src/BeamletBuffer.cc +++ b/Appl/CEP/CS1/CS1_IONProc/src/BeamletBuffer.cc @@ -167,6 +167,9 @@ void BeamletBuffer::resetCurrentTimeStamp(const TimeStamp &newTimeStamp) if (!aligned(itsCurrentI, itsNrTimesPerPacket)) { // RSP board reset? Recompute itsOffset and clear the entire buffer. + + itsLockedRanges.lock(0, itsSize, itsSize); // avoid reset while other thread reads + itsOffset = - (itsCurrentI % itsNrTimesPerPacket); itsCurrentI = mapTime2Index(newTimeStamp); @@ -174,6 +177,8 @@ void BeamletBuffer::resetCurrentTimeStamp(const TimeStamp &newTimeStamp) itsValidData.reset(); pthread_mutex_unlock(&itsValidDataMutex); + itsLockedRanges.unlock(0, itsSize, itsSize); + std::clog << "reset BeamletBuffer" << std::endl; } }