Skip to content
Snippets Groups Projects
Commit f5ff1a8e authored by Jan David Mol's avatar Jan David Mol
Browse files

bug 1303: more outputsection debug info

parent 446b2770
No related branches found
No related tags found
No related merge requests found
......@@ -461,7 +461,7 @@ void *master_thread(void *)
exit(1);
}
LOG_DEBUG("lofar__fini: output thread joined");
LOG_DEBUG("lofar__fini: output section joined");
}
#if defined FLAT_MEMORY
......
......@@ -103,28 +103,35 @@ void OutputThread::mainLoop()
doNotRunOnCore0();
#endif
// set the maximum number of concurrent writers
static Semaphore semaphore(1);
while ((o = itsSendQueueActivity.remove()) >= 0) {
struct OutputThread::SingleOutput &output = itsOutputs[o];
std::cout << "OutputThread: pop queue " << o << std::endl;
data = output.sendQueue.remove();
try {
std::cout << "OutputThread: lower semaphore " << std::endl;
semaphore.down();
try {
std::cout << "OutputThread: write data for queue " << o << std::endl;
// write header: nr of output
itsStreamToStorage->write( &o, sizeof o );
// write data, including serial nr
data->write(itsStreamToStorage, true);
semaphore.up();
output.freeQueue.append(data);
} catch (...) {
semaphore.up();
output.freeQueue.append(data);
throw;
}
std::cout << "OutputThread: raise semaphore and wait for next element " << std::endl;
semaphore.up();
output.freeQueue.append(data);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment