aboutsummaryrefslogtreecommitdiff
path: root/works/life/computer-network-experiment/Output.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-06-07 20:42:28 +0800
committercrupest <crupest@outlook.com>2021-06-07 20:42:28 +0800
commit42f7fc1876cbe68569771b97a8935fbca7fa3ee4 (patch)
tree1b59d74002c30f9aa14fac4d27e7d97b5d2ddcbe /works/life/computer-network-experiment/Output.cpp
parent2bc323cfa5d317188da591413bce7f1230e383b4 (diff)
downloadcrupest-42f7fc1876cbe68569771b97a8935fbca7fa3ee4.tar.gz
crupest-42f7fc1876cbe68569771b97a8935fbca7fa3ee4.tar.bz2
crupest-42f7fc1876cbe68569771b97a8935fbca7fa3ee4.zip
import(life): ...
Diffstat (limited to 'works/life/computer-network-experiment/Output.cpp')
-rw-r--r--works/life/computer-network-experiment/Output.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/works/life/computer-network-experiment/Output.cpp b/works/life/computer-network-experiment/Output.cpp
index db97e5e..fbbd6ba 100644
--- a/works/life/computer-network-experiment/Output.cpp
+++ b/works/life/computer-network-experiment/Output.cpp
@@ -47,7 +47,7 @@ void PrintOutput(const Output &output) {
void OutputThread() {
while (true) {
- m.lock();
+ std::lock_guard<std::mutex> guard(m);
if (cancellation_source.getToken().isCancellationRequested()) {
while (true) {
@@ -63,8 +63,6 @@ void OutputThread() {
Output output;
if (output_queue.readIfNotEmpty(output))
PrintOutput(output);
-
- m.unlock();
}
}