diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-02-08 15:27:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-02-13 12:42:42 +0200 |
commit | 29e92840c5eb6e56e047d1b0d2b80db66e9eaae5 (patch) | |
tree | 525cd9d1d8e4c19cfdd418e2fde2b21b0a38ffe0 /build2/scheduler.txx | |
parent | 8eed1ebf9ca2532fac255708a8dc418378c78b0a (diff) |
Make scheduler::async() indicate whether the task executed synchronously
Diffstat (limited to 'build2/scheduler.txx')
-rw-r--r-- | build2/scheduler.txx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/build2/scheduler.txx b/build2/scheduler.txx index 01408ca..d5e9afa 100644 --- a/build2/scheduler.txx +++ b/build2/scheduler.txx @@ -7,7 +7,7 @@ namespace build2 { template <typename F, typename... A> - void scheduler:: + bool scheduler:: async (size_t start_count, atomic_count& task_count, F&& f, A&&... a) { using task = task_type<F, A...>; @@ -56,7 +56,7 @@ namespace build2 if (td == nullptr) { forward<F> (f) (forward<A> (a)...); - return; + return false; } // Increment the task count. @@ -70,6 +70,8 @@ namespace build2 // if (active_ < max_active_) activate_helper (l); + + return true; } template <typename F, typename... A> |