OROCHI
 
Loading...
Searching...
No Matches
GxSysThread.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12#if GX_DEVELOP
13
14GX_CORE_NAMESPACE_BEGIN()
15
16//===========================================================================
18//===========================================================================
19class GxSysThread : public GxSysBase, public SingletonBase<GxSysThread>
20{
21 //-------------------------------------------------------------
23 //-------------------------------------------------------------
25public:
26 GX_RTTI_ABSTRACT_CLASS(GxSysThread, GxSysBase)
27 // ClassBase継承クラス用禁止宣言
28 GX_PROHIBIT_CLASS_BASE(GxSysThread)
29 // new, delete定義
30 GX_OPERATOR_NEW_DELETE( GxAllocatorList::ALLOCATOR_TYPE::SYSTEM )
31
32 class GxThreadInfo : public GxClassBase
33 {
34 //----------------------------------------------------
36 //----------------------------------------------------
38 public:
39 GX_RTTI_CLASS(GxThreadInfo, GxClassBase)
40
41
42 //--------------------------------------------------------
44 //--------------------------------------------------------
46
48 GxThreadInfo(void)
49 : _pThread (nullptr)
50 , _name (nullptr)
51 , _priority (GxThread::PRIORITY::NORMAL)
52 , _stackSize(0)
53 , _cpuIndex (-1)
54 {}
56 GxThreadInfo(GxThread* pThread, GxThread::PRIORITY priority, u32 stackSize, s32 cpuIndex)
57 : _pThread (pThread)
58 , _name (nullptr)
59 , _priority (priority)
60 , _stackSize(stackSize)
61 , _cpuIndex (cpuIndex)
62 {}
64 ~GxThreadInfo(void) override {}
65
67 //--------------------------------------------------------
69 //--------------------------------------------------------
71
72 GxThread* _pThread;
73 GX_CSTR _name;
74 GxThread::PRIORITY _priority;
75 u32 _stackSize;
76 s32 _cpuIndex;
77
79 };
80
82 //-------------------------------------------------------------
84 //-------------------------------------------------------------
86
88 GxSysThread( void ){}
90 ~GxSysThread (void) override {}
92 void terminate(void) override;
93
95 //-----------------------------------------------------------
97 //-----------------------------------------------------------
99
101 GxThreadInfo* addThreadInfo(GxThread* pThread, GxThread::PRIORITY priority, u32 stackSize , s32 cpuIndex);
103 b32 editThreadInfo(GxThread* pThread, GxThread::PRIORITY priority, u32 stackSize , s32 cpuIndex);
105 b32 removeThreadInfo(GxThread* pThread);
106
108 //-------------------------------------------------------------
110 //-------------------------------------------------------------
112private:
113 GxArrayClassBase _threadInfoArray;
114 GxCriticalSection _criticalSection;
115
117};
118
119// アクセスインターフェース
120GX_FORCE_INLINE GxSysThread* getGxSysThread(void){ return GxSysThread::getSingletonPointer(); }
121
122GX_CORE_NAMESPACE_END()
123
124#endif // GX_DEVELOP
#define GX_PROHIBIT_CLASS_BASE(__CLASS__)
GxClassBase継承の禁止宣言
Definition GxBase.h:240
@ NORMAL
法線(VS入力,VS→PS)
配列クラス
Definition GxArrayClassBase.h:18
オブジェクト基底クラス
Definition GxBase.h:88
クリティカルセクションクラス
Definition GxThread.h:20
システム基底クラス
Definition GxSysBase.h:18
スレッドクラス
Definition GxThread.h:177
PRIORITY
優先度
Definition GxThread.h:199
シングルトン基礎クラス
Definition GxSingleton.h:19
32bitブーリアン
Definition GxDefine.h:173