File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11527,8 +11527,8 @@ Thread creation is expensive.
11527
11527
11528
11528
void master(istream& is)
11529
11529
{
11530
- for (Message m; is>> m; )
11531
- run_list.push_back(new thread(worker,m);}
11530
+ for (Message m; is >> m; )
11531
+ run_list.push_back(new thread(worker, m));
11532
11532
}
11533
11533
11534
11534
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.
11913
11913
11914
11914
atomic<bool> x_init;
11915
11915
11916
- if (!x_init.load(memory_order_acquire) {
11916
+ if (!x_init.load(memory_order_acquire)) {
11917
11917
lock_guard<mutex> lck(x_mutex);
11918
- if (!x_init.load(memory_order_relaxed) {
11918
+ if (!x_init.load(memory_order_relaxed)) {
11919
11919
// ... initialize x ...
11920
11920
x_init.store(true, memory_order_release);
11921
11921
}
You can’t perform that action at this time.
0 commit comments