aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-04 10:34:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-04 10:34:27 +0200
commit8240b1f8664195865ad69aabeb1375c2b7f2d364 (patch)
tree5e9ca15d99febd36cbd3ef436128e8d1373a497c
parent7a0309b5dd37acb30321716794fba4449b374add (diff)
Handle phase_lock failure in async match tasks
-rw-r--r--build2/algorithm.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index a532d7c..2ea2d1a 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -613,12 +613,16 @@ namespace build2
const diag_frame* ds)
{
diag_frame df (ds);
- phase_lock pl (run_phase::match);
+ try
{
- target_lock l {&t, offset}; // Reassemble.
- match_impl (a, l, false /* step */, try_match);
- // Unlock withing the match phase.
+ phase_lock pl (run_phase::match); // Can throw.
+ {
+ target_lock l {&t, offset}; // Reassemble.
+ match_impl (a, l, false /* step */, try_match);
+ // Unlock withing the match phase.
+ }
}
+ catch (const failed&) {} // Phase lock failure.
},
ref (*l.release ()),
l.offset,