From 2c4330e7c01cf404406dd3380e64304460b29b02 Mon Sep 17 00:00:00 2001 From: johannst Date: Mon, 5 Oct 2020 23:03:03 +0200 Subject: added doc on thread & executor --- lib/thread.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/thread.cc') diff --git a/lib/thread.cc b/lib/thread.cc index ed2dee3..424041d 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -41,8 +41,12 @@ namespace nMatcha { mStackPtr = init_stack(mStackPtr, Thread::entry, static_cast(this)); } - void Thread::entry(void* obj) { - Thread* t = static_cast(obj); + bool Thread::isFinished() const { + return mFinished; + } + + void Thread::entry(void* ctx) { + Thread* t = static_cast(ctx); try { t->threadFn(); } catch (const std::exception& e) { -- cgit v1.2.3