diff options
Diffstat (limited to 'lib/thread.cc')
-rw-r--r-- | lib/thread.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/thread.cc b/lib/thread.cc index 31161ab..e6777c0 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -56,4 +56,10 @@ namespace nMatcha { assert(mExecutor); ::yield(mExecutor->getStackPtr(), &mStackPtr); } + + std::unique_ptr<Thread> FnThread::make(UserFn f) { return std::make_unique<FnThread>(CreatorToken{}, f); } + + void FnThread::threadFn() { mUserFn(*this); } + + void FnThread::yield() { Thread::yield(); } } // namespace nMatcha |