diff options
Diffstat (limited to 'works/life/computer-network-experiment/Output.cpp')
-rw-r--r-- | works/life/computer-network-experiment/Output.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/works/life/computer-network-experiment/Output.cpp b/works/life/computer-network-experiment/Output.cpp new file mode 100644 index 0000000..41e14e6 --- /dev/null +++ b/works/life/computer-network-experiment/Output.cpp @@ -0,0 +1,18 @@ +#include "Output.h"
+
+folly::MPMCQueue<Output> output_queue;
+
+void OutputThread() {
+ while (true) {
+ Output output;
+ output_queue.blockingRead(output);
+ switch (output.type) {
+ case OutputType::Error:
+ std::wcerr << output.message;
+ break;
+ default:
+ std::wcout << output.message;
+ break;
+ }
+ }
+}
|