diff options
author | johannst <johannes.stoelp@gmail.com> | 2020-09-26 23:58:24 +0200 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2020-09-26 23:58:24 +0200 |
commit | 1b1bd56777358ef2fa538a9b7b62c6e8c823489b (patch) | |
tree | eeeb80ac415999857093631696c81b02d2217bcc /lib/executor.cc | |
parent | 5cbdde2c97229a552852af57232c4e5bbe814a38 (diff) | |
download | matcha-threads-1b1bd56777358ef2fa538a9b7b62c6e8c823489b.tar.gz matcha-threads-1b1bd56777358ef2fa538a9b7b62c6e8c823489b.zip |
added finished flag to thread + catch exceptions in thread entry function as unwinding across entry fn would be catastrophic
Diffstat (limited to 'lib/executor.cc')
-rw-r--r-- | lib/executor.cc | 3 |
1 files changed, 3 insertions, 0 deletions
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<Thread>& t : mThreads) { + if (t->isFinished()) { + continue; + } yield_to(t.get()); } } |