From 1b1bd56777358ef2fa538a9b7b62c6e8c823489b Mon Sep 17 00:00:00 2001 From: johannst Date: Sat, 26 Sep 2020 23:58:24 +0200 Subject: added finished flag to thread + catch exceptions in thread entry function as unwinding across entry fn would be catastrophic --- lib/executor.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/executor.cc') diff --git a/lib/executor.cc b/lib/executor.cc index fb79b49..af49f0e 100644 --- a/lib/executor.cc +++ b/lib/executor.cc @@ -12,6 +12,9 @@ namespace nMatcha { void Executor::run() { for (const std::unique_ptr& t : mThreads) { + if (t->isFinished()) { + continue; + } yield_to(t.get()); } } -- cgit v1.2.3