aboutsummaryrefslogtreecommitdiff
path: root/build2/operation.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/operation.cxx')
-rw-r--r--build2/operation.cxx36
1 files changed, 22 insertions, 14 deletions
diff --git a/build2/operation.cxx b/build2/operation.cxx
index 0163e04..0ade4bb 100644
--- a/build2/operation.cxx
+++ b/build2/operation.cxx
@@ -74,6 +74,8 @@ namespace build2
{
tracer trace ("search");
+ phase_guard pg (run_phase::search_match);
+
auto i (targets.find (tk, trace));
if (i == targets.end ())
fail (l) << "unknown target " << tk;
@@ -89,25 +91,29 @@ namespace build2
if (verb >= 6)
dump (a);
- scheduler::atomic_count task_count (0);
{
- model_slock ml;
+ phase_guard pg (run_phase::search_match);
- for (void* vt: ts)
+ scheduler::atomic_count task_count (0);
{
- target& t (*static_cast<target*> (vt));
- l5 ([&]{trace << "matching " << t;});
-
- sched.async (task_count,
- [a] (target& t)
- {
- model_slock ml;
- match (ml, a, t); // @@ MT exception handling.
- },
- ref (t));
+ model_slock ml;
+
+ for (void* vt: ts)
+ {
+ target& t (*static_cast<target*> (vt));
+ l5 ([&]{trace << "matching " << t;});
+
+ sched.async (task_count,
+ [a] (target& t)
+ {
+ model_slock ml;
+ match (ml, a, t); // @@ MT exception handling.
+ },
+ ref (t));
+ }
}
+ sched.wait (task_count);
}
- sched.wait (task_count);
if (verb >= 6)
dump (a);
@@ -118,6 +124,8 @@ namespace build2
{
tracer trace ("execute");
+ phase_guard pg (run_phase::execute);
+
// Execute collecting postponed targets (to be re-examined later).
// Do it in reverse order if the execution mode is 'last'.
//