Serializes textual reporting from concurrent threads. More...
#include <global.hpp>
Static Public Member Functions | |
| static void | print (std::ostream &os, std::ostringstream &sos) |
Writes sos's buffered content to os, serializing concurrent writers under FST_THREADED via a shared mutex. | |
Static Private Member Functions | |
| static std::mutex & | get_io_mutex () |
| Returns the process-wide mutex guarding concurrent output via print() (FST_THREADED builds only). | |
Serializes textual reporting from concurrent threads.
The class holds no state and is never instantiated (the constructor is private); it exists only as the scope of the static print() service and of the mutex that guards it. Every output produced from code that may run inside a threaded search must go through syncout::print() – writing to std::cout directly from several threads interleaves characters and, in the worst case, stalls the reporting.
|
inlinestatic |
Writes sos's buffered content to os, serializing concurrent writers under FST_THREADED via a shared mutex.
| os | the output stream to write to |
| sos | the buffered message content to flush |