diff options
author | crupest <crupest@outlook.com> | 2021-06-06 21:33:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-06 21:33:52 +0800 |
commit | c548f911b47d8bbaa951e9e5d18bf9f1f95afacb (patch) | |
tree | fba5390774f02279713bbf7863e733058b778293 /computer-network-experiment/Output.cpp | |
parent | 798c0b24b1f26f42cc28642d389f790612ea738f (diff) | |
download | life-c548f911b47d8bbaa951e9e5d18bf9f1f95afacb.tar.gz life-c548f911b47d8bbaa951e9e5d18bf9f1f95afacb.tar.bz2 life-c548f911b47d8bbaa951e9e5d18bf9f1f95afacb.zip |
...
Diffstat (limited to 'computer-network-experiment/Output.cpp')
-rw-r--r-- | computer-network-experiment/Output.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/computer-network-experiment/Output.cpp b/computer-network-experiment/Output.cpp new file mode 100644 index 0000000..41e14e6 --- /dev/null +++ b/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;
+ }
+ }
+}
|