From a523eb1b8b74a577e7ff0aa3fce4312acd4b3a75 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 14 Feb 2017 12:32:59 +0200 Subject: Redo library meta-information protocol without match_only() --- build2/algorithm.ixx | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'build2/algorithm.ixx') diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index 6bc310f..6bbe4bb 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -63,7 +63,7 @@ namespace build2 pair match_impl (slock&, action, target&, bool apply, const rule* skip = nullptr); - inline void + inline bool match (slock& ml, action a, target& t) { assert (phase == run_phase::search_match); @@ -71,10 +71,12 @@ namespace build2 if (!t.recipe (a)) match_impl (ml, a, t, true); - t.dependents.fetch_add (1, std::memory_order_release); dependency_count.fetch_add (1, std::memory_order_release); + bool r (t.dependents++ != 0); // Safe if someone else is also a dependent. // text << "M " << t << ": " << t.dependents << " " << dependency_count; + + return r; } inline void @@ -94,15 +96,6 @@ namespace build2 #endif } - inline void - match_only (slock& ml, action a, target& t) - { - assert (phase == run_phase::search_match); - - if (!t.recipe (a)) - match_impl (ml, a, t, false); - } - inline pair match_delegate (slock& ml, action a, target& t, const rule& r) { -- cgit v1.1