From 31eafed8d219b15f7db1d1bc74939ef091d6015a Mon Sep 17 00:00:00 2001 From: q66 Date: Tue, 13 Jun 2017 20:26:14 +0200 Subject: [PATCH] wait for remaining build tasks to finish --- main.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/main.cc b/main.cc index 1a3bf39..bae6327 100644 --- a/main.cc +++ b/main.cc @@ -157,10 +157,20 @@ struct ob_state: cs_state { throw; } waiting.pop(); - while (!waits.empty()) { - /* TODO: wait for unfinished tasks */ - waits.front().get(); - waits.pop(); + for (; !waits.empty(); waits.pop()) { + try { + waits.front().get(); + } catch (build_error const &) { + waits.pop(); + for (; !waits.empty(); waits.pop()) { + try { + waits.front().get(); + } catch (build_error const &) { + /* no rethrow */ + } + } + throw; + } } }