mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-11-18 00:10:04 +01:00
Add sleep at start of thread
This commit is contained in:
1 parent
4e3ec6af1f
commit
5b77313133
1 file changed
+4
@@ -46,10 +46,14 @@ int main (int argc, char *argv[]) {
|
||||
// TODO: Optimize this away and pass it with the RB.
|
||||
auto* jf_file_format_buffer = new JFFileFormat();
|
||||
|
||||
// Wait for 1 event to accumulate.
|
||||
this_thread::sleep_for(chrono::milliseconds(10));
|
||||
|
||||
while (true) {
|
||||
auto data = ring_buffer.read();
|
||||
|
||||
if (data.first == nullptr) {
|
||||
// TODO: Try to sleep at the end of a succesful loop.
|
||||
this_thread::sleep_for(chrono::milliseconds(10));
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user