Worker class
Base classes
- class Thread
Public types
- enum class HeapNullOption { AlwaysUseSpecifiedHeap = 0, UseSpecifiedOrContainHeap = 1, DoNotAppendDisposerIfNoHeapSpecified = 2, UseSpecifiedOrCurrentHeap = 3 }
- enum class NodeClassType { Reflexible = 0, Node = 1, Other = 2 }
- enum class AllocFlg { Name = 1u << 0u, Meta = 1u << 1u }
Public static variables
-
static MessageQueue::
Element cMsg_Process constexpr - static const s32 cDefaultPriority
Public static functions
- static void yield()
- static void sleep(TickSpan howLong)
- static auto getListNodeOffset() -> u32
Constructors, destructors, conversion operators
- SEAD_ENUM(State, cSleep, cWakeup, cRunning, cRunning_WaitLock, cRunning_GetLock, cRunning_Run, cRunning_AfterRun, cRunning_BeforeReturn, cRunning_AllJobDoneReturn, cFinished, cWaitingAtWorker) Worker(WorkerMgr *mgr
Public functions
- auto pushJobQueue(const char* name, JobQueue* queue, JobQueuePushType type) -> bool
- void clearJobQQ()
- void setState(Worker::State state)
- void destroy() virtual
-
auto sendMessage(MessageQueue::
Element msg, MessageQueue:: BlockType block_type) -> bool virtual -
auto recvMessage(MessageQueue::
BlockType block_type) -> MessageQueue:: Element virtual - auto getMessageQueue() const -> const MessageQueue& virtual
- auto start() -> bool virtual
- void quit(bool is_jam) virtual
- void waitDone() virtual
- void quitAndDestroySingleThread(bool is_jam) virtual
- void quitAndWaitDoneSingleThread(bool is_jam) virtual
- void setPriority(s32 prio) virtual
- auto getPriority() const -> s32 virtual
-
auto getBlockType() const -> MessageQueue::
BlockType virtual - auto getStackSize() const -> s32 virtual
- auto calcStackUsedSizePeak() const -> s32 virtual
- auto getId() const -> u32
- auto getState() const -> State
- auto isDone() const -> bool
- auto isActive() const -> bool
- auto getAffinity() const -> const CoreIdMask&
- void setAffinity(const CoreIdMask& affinity)
- void checkStackOverFlow(const char* source_file, s32 source_line) const
- void checkStackEndCorruption(const char* source_file, s32 source_line) const
- void checkStackPointerOverFlow(const char* source_file, s32 source_line) const
- void setStackOverflowExceptionEnable(bool)
- auto getThreadListNode() -> ThreadListNode*
- auto isDefaultPriority() const -> bool
- auto getCurrentHeap() const -> Heap*
- auto setCurrentHeap(Heap* heap) -> Heap*
- auto getFindContainHeapCache() -> FindContainHeapCache*
- auto getName() const -> const SafeString&
- void setName(const SafeString& name)
- auto getNodeClassType() const -> NodeClassType virtual
Public variables
Protected functions
-
void calc_(MessageQueue::
Element msg) override - void proc_() virtual
- auto getNextJQ_() -> JobQueue*
-
void wakeup_(MessageQueue::
Element msg) - void run_() virtual
- auto getStackCheckStartAddress_() const -> uintptr_t virtual
- void initStackCheck_()
- void initStackCheckWithCurrentStackPointer_()
- auto getDisposerHeap_() const -> Heap*
Protected variables
- CoreId mCore
- Atomic<Worker::State> mWorkerState
- WorkerMgr* mMgr
- RingBuffer<JobQueue*> mJobQueues
- JobQueueLock mLock
- JobQueue* mCurrentQueue
- const char* mCurrentQueueDescription
- u32 mNumRuns
- TickTime mLastRun
- Event mEvent
- MessageQueue mMessageQueue
- s32 mStackSize
- ThreadListNode mListNode
- Heap* mCurrentHeap
- FindContainHeapCache mFindContainHeapCache
-
MessageQueue::
BlockType mBlockType -
MessageQueue::
Element mQuitMsg - u32 mId
- State mState
- CoreIdMask mAffinity
- void* mStackTop
- void* mStackTopForCheck
- s32 mPriority
Enum documentation
enum class sead:: Worker:: HeapNullOption
#include <heap/seadDisposer.h>
enum class sead:: Worker:: NodeClassType
#include <hostio/seadHostIOReflexible.h>
| Enumerators | |
|---|---|
| Reflexible | |
| Node | |
| Other |
Other classes. |
enum class sead:: Worker:: AllocFlg
#include <hostio/seadHostIOReflexible.h>
Function documentation
static void sead:: Worker:: yield()
#include <thread/seadThread.h>
static void sead:: Worker:: sleep(TickSpan howLong)
#include <thread/seadThread.h>
static u32 sead:: Worker:: getListNodeOffset()
#include <heap/seadDisposer.h>
void sead:: Worker:: destroy() virtual
#include <thread/seadThread.h>
bool sead:: Worker:: sendMessage(MessageQueue:: Element msg,
MessageQueue:: BlockType block_type) virtual
#include <thread/seadThread.h>
MessageQueue:: Element sead:: Worker:: recvMessage(MessageQueue:: BlockType block_type) virtual
#include <thread/seadThread.h>
const MessageQueue& sead:: Worker:: getMessageQueue() const virtual
#include <thread/seadThread.h>
bool sead:: Worker:: start() virtual
#include <thread/seadThread.h>
void sead:: Worker:: quit(bool is_jam) virtual
#include <thread/seadThread.h>
void sead:: Worker:: waitDone() virtual
#include <thread/seadThread.h>
void sead:: Worker:: quitAndDestroySingleThread(bool is_jam) virtual
#include <thread/seadThread.h>
void sead:: Worker:: quitAndWaitDoneSingleThread(bool is_jam) virtual
#include <thread/seadThread.h>
void sead:: Worker:: setPriority(s32 prio) virtual
#include <thread/seadThread.h>
s32 sead:: Worker:: getPriority() const virtual
#include <thread/seadThread.h>
MessageQueue:: BlockType sead:: Worker:: getBlockType() const virtual
#include <thread/seadThread.h>
s32 sead:: Worker:: getStackSize() const virtual
#include <thread/seadThread.h>
s32 sead:: Worker:: calcStackUsedSizePeak() const virtual
#include <thread/seadThread.h>
u32 sead:: Worker:: getId() const
#include <thread/seadThread.h>
State sead:: Worker:: getState() const
#include <thread/seadThread.h>
bool sead:: Worker:: isDone() const
#include <thread/seadThread.h>
bool sead:: Worker:: isActive() const
#include <thread/seadThread.h>
const CoreIdMask& sead:: Worker:: getAffinity() const
#include <thread/seadThread.h>
void sead:: Worker:: setAffinity(const CoreIdMask& affinity)
#include <thread/seadThread.h>
void sead:: Worker:: checkStackOverFlow(const char* source_file,
s32 source_line) const
#include <thread/seadThread.h>
void sead:: Worker:: checkStackEndCorruption(const char* source_file,
s32 source_line) const
#include <thread/seadThread.h>
void sead:: Worker:: checkStackPointerOverFlow(const char* source_file,
s32 source_line) const
#include <thread/seadThread.h>
void sead:: Worker:: setStackOverflowExceptionEnable(bool)
#include <thread/seadThread.h>
ThreadListNode* sead:: Worker:: getThreadListNode()
#include <thread/seadThread.h>
bool sead:: Worker:: isDefaultPriority() const
#include <thread/seadThread.h>
Heap* sead:: Worker:: getCurrentHeap() const
#include <thread/seadThread.h>
Heap* sead:: Worker:: setCurrentHeap(Heap* heap)
#include <thread/seadThread.h>
FindContainHeapCache* sead:: Worker:: getFindContainHeapCache()
#include <thread/seadThread.h>
const SafeString& sead:: Worker:: getName() const
#include <prim/seadNamable.h>
void sead:: Worker:: setName(const SafeString& name)
#include <prim/seadNamable.h>
NodeClassType sead:: Worker:: getNodeClassType() const virtual
#include <hostio/seadHostIOReflexible.h>
void sead:: Worker:: run_() virtual protected
#include <thread/seadThread.h>
uintptr_t sead:: Worker:: getStackCheckStartAddress_() const virtual protected
#include <thread/seadThread.h>
void sead:: Worker:: initStackCheck_() protected
#include <thread/seadThread.h>
void sead:: Worker:: initStackCheckWithCurrentStackPointer_() protected
#include <thread/seadThread.h>
Heap* sead:: Worker:: getDisposerHeap_() const protected
#include <heap/seadDisposer.h>
Variable documentation
static const s32 sead:: Worker:: cDefaultPriority
#include <thread/seadThread.h>
MessageQueue sead:: Worker:: mMessageQueue protected
#include <thread/seadThread.h>
s32 sead:: Worker:: mStackSize protected
#include <thread/seadThread.h>
ThreadListNode sead:: Worker:: mListNode protected
#include <thread/seadThread.h>
Heap* sead:: Worker:: mCurrentHeap protected
#include <thread/seadThread.h>
FindContainHeapCache sead:: Worker:: mFindContainHeapCache protected
#include <thread/seadThread.h>
MessageQueue:: BlockType sead:: Worker:: mBlockType protected
#include <thread/seadThread.h>
MessageQueue:: Element sead:: Worker:: mQuitMsg protected
#include <thread/seadThread.h>
u32 sead:: Worker:: mId protected
#include <thread/seadThread.h>
State sead:: Worker:: mState protected
#include <thread/seadThread.h>
CoreIdMask sead:: Worker:: mAffinity protected
#include <thread/seadThread.h>
void* sead:: Worker:: mStackTop protected
#include <thread/seadThread.h>
void* sead:: Worker:: mStackTopForCheck protected
#include <thread/seadThread.h>
s32 sead:: Worker:: mPriority protected
#include <thread/seadThread.h>