From 8240b1f8664195865ad69aabeb1375c2b7f2d364 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Dec 2017 10:34:27 +0200 Subject: Handle phase_lock failure in async match tasks --- build2/algorithm.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'build2/algorithm.cxx') 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, -- cgit v1.1