aboutsummaryrefslogtreecommitdiff
path: root/build2/scheduler.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-02-12 18:34:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-02-12 18:34:31 +0200
commit5d615c7ae1761d1511e01d0b4bea4920fda190a7 (patch)
tree4eb34289cc59ed54765ea6ad6323617944efc2d0 /build2/scheduler.hxx
parentf5bc31da2a84b81fef5da8a59da66a2386adbea6 (diff)
Add default capping of stack size for all POSIX platforms, --max-stack
Diffstat (limited to 'build2/scheduler.hxx')
-rw-r--r--build2/scheduler.hxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/build2/scheduler.hxx b/build2/scheduler.hxx
index 4880392..d90a26f 100644
--- a/build2/scheduler.hxx
+++ b/build2/scheduler.hxx
@@ -164,9 +164,10 @@ namespace build2
scheduler (size_t max_active,
size_t init_active = 1,
size_t max_threads = 0,
- size_t queue_depth = 0)
+ size_t queue_depth = 0,
+ optional<size_t> max_stack = nullopt)
{
- startup (max_active, init_active, max_threads, queue_depth);
+ startup (max_active, init_active, max_threads, queue_depth, max_stack);
}
// Start the scheduler.
@@ -175,7 +176,8 @@ namespace build2
startup (size_t max_active,
size_t init_active = 1,
size_t max_threads = 0,
- size_t queue_depth = 0);
+ size_t queue_depth = 0,
+ optional<size_t> max_stack = nullopt);
// Return true if the scheduler was started up.
//
@@ -386,6 +388,8 @@ namespace build2
std::mutex mutex_;
bool shutdown_ = true; // Shutdown flag.
+ optional<size_t> max_stack_;
+
// The constraints that we must maintain:
//
// active <= max_active