aboutsummaryrefslogtreecommitdiff
path: root/build2/scheduler.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-08 07:42:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commit5cefca444f7062c61cc9d118ffea5901e05186fd (patch)
tree879d608f9a9084c7eaa4e5cb8bcad5650d966730 /build2/scheduler.cxx
parentdb2a696f810e41189bcdf5524696ff3d0cfbe5a9 (diff)
Implement parallel operation execution
Diffstat (limited to 'build2/scheduler.cxx')
-rw-r--r--build2/scheduler.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/build2/scheduler.cxx b/build2/scheduler.cxx
index edfa02c..244f6b8 100644
--- a/build2/scheduler.cxx
+++ b/build2/scheduler.cxx
@@ -84,11 +84,11 @@ namespace build2
//
s.tcount = &tc;
- // Since we use a mutex for synchronization, we can relax the atomic
- // access.
+ // We could probably relax the atomic access since we use a mutex for
+ // synchronization though this has a different tradeoff (calling wait
+ // because we don't see the count).
//
- while (!(s.shutdown ||
- tc.load (std::memory_order_relaxed) <= start_count))
+ while (!(s.shutdown || tc <= start_count))
s.condv.wait (l);
s.waiters--;