From 5d615c7ae1761d1511e01d0b4bea4920fda190a7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 12 Feb 2018 18:34:31 +0200 Subject: Add default capping of stack size for all POSIX platforms, --max-stack --- build2/scheduler.hxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'build2/scheduler.hxx') 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 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 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 max_stack_; + // The constraints that we must maintain: // // active <= max_active -- cgit v1.1