diff options
Diffstat (limited to 'libbuild2')
-rw-r--r-- | libbuild2/context.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx index 09ab15d..b4ba5df 100644 --- a/libbuild2/context.cxx +++ b/libbuild2/context.cxx @@ -664,7 +664,12 @@ namespace build2 // if (p == run_phase::load) { - lm_.lock (); + if (!lm_.try_lock ()) + { + ctx_.sched.deactivate (false /* external */); + lm_.lock (); + ctx_.sched.activate (false /* external */); + } r = !fail_; // Re-query. } @@ -773,7 +778,12 @@ namespace build2 if (n == run_phase::load) { - lm_.lock (); + if (!lm_.try_lock ()) + { + ctx_.sched.deactivate (false /* external */); + lm_.lock (); + ctx_.sched.activate (false /* external */); + } r = !fail_; // Re-query. } |