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 *) ...@@ -461,7 +461,7 @@ void *master_thread(void *)
exit(1); exit(1);
} }
LOG_DEBUG("lofar__fini: output thread joined"); LOG_DEBUG("lofar__fini: output section joined");
} }
#if defined FLAT_MEMORY #if defined FLAT_MEMORY
......
...@@ -103,28 +103,35 @@ void OutputThread::mainLoop() ...@@ -103,28 +103,35 @@ void OutputThread::mainLoop()
doNotRunOnCore0(); doNotRunOnCore0();
#endif #endif
// set the maximum number of concurrent writers
static Semaphore semaphore(1); static Semaphore semaphore(1);
while ((o = itsSendQueueActivity.remove()) >= 0) { while ((o = itsSendQueueActivity.remove()) >= 0) {
struct OutputThread::SingleOutput &output = itsOutputs[o]; struct OutputThread::SingleOutput &output = itsOutputs[o];
std::cout << "OutputThread: pop queue " << o << std::endl;
data = output.sendQueue.remove(); data = output.sendQueue.remove();
std::cout << "OutputThread: lower semaphore " << std::endl;
semaphore.down();
try { try {
semaphore.down(); std::cout << "OutputThread: write data for queue " << o << std::endl;
// write header: nr of output // write header: nr of output
itsStreamToStorage->write( &o, sizeof o ); itsStreamToStorage->write( &o, sizeof o );
// write data, including serial nr // write data, including serial nr
data->write(itsStreamToStorage, true); data->write(itsStreamToStorage, true);
semaphore.up();
output.freeQueue.append(data);
} catch (...) { } catch (...) {
semaphore.up();
output.freeQueue.append(data); output.freeQueue.append(data);
throw; 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.
Finish editing this message first!
Please register or to comment