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/thread.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/thread.h') diff --git a/lib/thread.h b/lib/thread.h index e392052..d983734 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -13,12 +13,15 @@ namespace nMatcha { virtual void threadFn() = 0; + bool isFinished() const { return mFinished; } + protected: void yield(); private: static void entry(void* obj); void* mStackPtr; + bool mFinished; friend struct Executor; const Executor* mExecutor; -- cgit v1.2.3