diff options
Diffstat (limited to 'works/life/computer-network-experiment/Output.cpp')
-rw-r--r-- | works/life/computer-network-experiment/Output.cpp | 4 |
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();
}
}
|