| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | #include <prim/seadSafeString.h> |
| 5 | #include <thread/seadMessageQueue.h> |
| 6 | |
| 7 | namespace sead { |
| 8 | class Heap; |
| 9 | class DelegateThread; |
| 10 | class Thread; |
| 11 | } // namespace sead |
| 12 | |
| 13 | namespace al { |
| 14 | class FunctorBase; |
| 15 | |
| 16 | class InitializeThread { |
| 17 | public: |
| 18 | InitializeThread(const sead::SafeString& threadName, const FunctorBase& functor, |
| 19 | sead::Heap* heap, s32 priority, s32 stackSize); |
| 20 | void start(); |
| 21 | bool tryWaitDoneAndDestroy(); |
| 22 | |
| 23 | private: |
| 24 | void threadFunction(sead::Thread* thread, sead::MessageQueue::Element message); |
| 25 | |
| 26 | sead::DelegateThread* mThread = nullptr; |
| 27 | sead::Heap* mHeap = nullptr; |
| 28 | FunctorBase* mFunctor = nullptr; |
| 29 | bool mIsDone = false; |
| 30 | }; |
| 31 | } // namespace al |
| 32 |