From 92dd62e0e565f177ab5861a9511bc0e303f61a79 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 23 Aug 2019 14:54:53 +0200 Subject: scheduler --- libbuild2/context.hxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'libbuild2/context.hxx') diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx index 5060773..23cbdb9 100644 --- a/libbuild2/context.hxx +++ b/libbuild2/context.hxx @@ -19,6 +19,8 @@ namespace build2 { + class context; + class scope; class scope_map; class target_set; @@ -35,12 +37,6 @@ namespace build2 struct opspec; - // Main scheduler. Started up and shut down in main(). - // - // @@ CTX: move to main(). - // - LIBBUILD2_SYMEXPORT extern scheduler sched; - class LIBBUILD2_SYMEXPORT run_phase_mutex { public: @@ -65,8 +61,8 @@ namespace build2 private: friend class context; - run_phase_mutex (run_phase& p) - : phase_ (p), fail_ (false), lc_ (0), mc_ (0), ec_ (0) {} + run_phase_mutex (context& c) + : ctx_ (c), fail_ (false), lc_ (0), mc_ (0), ec_ (0) {} private: friend struct phase_lock; @@ -83,7 +79,7 @@ namespace build2 // When the mutex is unlocked (all three counters become zero, the phase // is always changed to load (this is also the initial state). // - run_phase& phase_; + context& ctx_; mutex m_; -- cgit v1.1