diff options
author | johannst <johannes.stoelp@gmail.com> | 2020-10-05 23:03:03 +0200 |
---|---|---|
committer | johannst <johannes.stoelp@gmail.com> | 2020-10-05 23:03:03 +0200 |
commit | 2c4330e7c01cf404406dd3380e64304460b29b02 (patch) | |
tree | 588bbbd660e16c45d3578fea988b9566cf9b3387 /lib/thread.cc | |
parent | abba364fb3b8871a2baac7779b0850b3bdc479b0 (diff) | |
download | matcha-threads-2c4330e7c01cf404406dd3380e64304460b29b02.tar.gz matcha-threads-2c4330e7c01cf404406dd3380e64304460b29b02.zip |
added doc on thread & executor
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) { |