aboutsummaryrefslogtreecommitdiff
path: root/build2/scheduler
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-10 08:15:48 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commitabccaf9596461215fce0e32322133fb6c39be44f (patch)
tree3fc16a6e6142d65e6b47ae686ab845cc164478cc /build2/scheduler
parentbcb2a89e111a918a48a132a2a29e0c26d724591d (diff)
Implement parallel error propagation, keep_going mode
Keep going is the default but there is now the -s|--serial-stop that makes the driver run serially and stop at first error. Also fix some lockups, other minor improvements/features.
Diffstat (limited to 'build2/scheduler')
-rw-r--r--build2/scheduler10
1 files changed, 10 insertions, 0 deletions
diff --git a/build2/scheduler b/build2/scheduler
index d2eb0fc..c487b88 100644
--- a/build2/scheduler
+++ b/build2/scheduler
@@ -155,6 +155,14 @@ namespace build2
size_t max_threads = 0,
size_t queue_depth = 0);
+ // Return true if the scheduler was started up.
+ //
+ // Note: can only be called from threads that have observed creation,
+ // startup, or shutdown.
+ //
+ bool
+ started () const {return !shutdown_;}
+
// Tune a started up scheduler.
//
// Currently one cannot increase the number of max_active. Pass 0 to
@@ -170,6 +178,8 @@ namespace build2
// Return true if the scheduler is running serial.
//
+ // Note: can only be called from threads that have observed startup.
+ //
bool
serial () const {return max_active_ == 1;}