From 12bdb63b06da25a939d3a9fcd109985c2ce576ac Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Thu, 11 Aug 2016 17:56:53 +0200 Subject: [PATCH] fix parens --- CppCoreGuidelines.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 6a506d1..7b0c207 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -11527,8 +11527,8 @@ Thread creation is expensive. void master(istream& is) { - for (Message m; is>>m; ) - run_list.push_back(new thread(worker,m);} + for (Message m; is >> m; ) + run_list.push_back(new thread(worker, m)); } This spawns a `thread` per message, and the `run_list` is presumably managed to destroy those tasks once they are finished. @@ -11913,9 +11913,9 @@ Double-checked locking is easy to mess up. atomic x_init; - if (!x_init.load(memory_order_acquire) { + if (!x_init.load(memory_order_acquire)) { lock_guard lck(x_mutex); - if (!x_init.load(memory_order_relaxed) { + if (!x_init.load(memory_order_relaxed)) { // ... initialize x ... x_init.store(true, memory_order_release); }