diff options
Diffstat (limited to 'lib/thread.cc')
-rw-r--r-- | lib/thread.cc | 8 |
1 files changed, 6 insertions, 2 deletions
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<void*>(this)); } - void Thread::entry(void* obj) { - Thread* t = static_cast<Thread*>(obj); + bool Thread::isFinished() const { + return mFinished; + } + + void Thread::entry(void* ctx) { + Thread* t = static_cast<Thread*>(ctx); try { t->threadFn(); } catch (const std::exception& e) { |