Skip to content

Commit fad0325

Browse files
committed
readout_worker: flush output buffer on transition to paused/resumed
This way the pause/resume system events will show up in the output immediately instead of being stuck, waiting to be flushed (which in case of the running -> paused transition would never happen as no more data was coming in :-)).
1 parent 4b03df5 commit fad0325

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mesytec-mvlc/mvlc_readout_worker.cc

+2
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,7 @@ void ReadoutWorker::Private::loop(std::promise<std::error_code> promise)
10091009
terminateReadout();
10101010
listfile::ReadoutBufferWriteHandle wh(*getOutputBuffer());
10111011
listfile_write_timestamp_section(wh, crateId, system_event::subtype::Pause);
1012+
flushCurrentOutputBuffer();
10121013
setState(State::Paused);
10131014
logger->debug("MVLC readout paused");
10141015
}
@@ -1018,6 +1019,7 @@ void ReadoutWorker::Private::loop(std::promise<std::error_code> promise)
10181019
startReadout();
10191020
listfile::ReadoutBufferWriteHandle wh(*getOutputBuffer());
10201021
listfile_write_timestamp_section(wh, crateId, system_event::subtype::Resume);
1022+
flushCurrentOutputBuffer();
10211023
setState(State::Running);
10221024
logger->debug("MVLC readout resumed");
10231025
}

0 commit comments

Comments
 (0)