OROCHI
 
Loading...
Searching...
No Matches
GxP2PThread.h
Go to the documentation of this file.
1//===========================================================================
11//===========================================================================
12#pragma once
13
14GX_P2P_NAMESPACE_BEGIN()
15
16//===========================================================================
18//===========================================================================
20{
21 //------------------------------------------------------------
23 //------------------------------------------------------------
25private:
27 static constexpr nu32 THREAD_DEFAULT_PRIORITY = 1;
28
30 //------------------------------------------------------------
32 //------------------------------------------------------------
34public:
36 GxP2PThreadBase(void);
38 virtual ~GxP2PThreadBase(void);
39
41 //------------------------------------------------------------
43 //------------------------------------------------------------
45public:
47 b32 create(void* pIn, nu32 priority = THREAD_DEFAULT_PRIORITY, nu32 stackSize = 0);
49 void destroy(void);
50
51protected:
53 virtual void threadMain(void* pIn) = 0;
54
55public:
57 static void sleep(nu32 msec);
58
59private:
61#if defined(_PS4)
62 static void* WINAPI threadEntryPoint(void* pContext);
63#elif defined(_PS5)
64 static void* threadEntryPoint(void* pContext);
65#elif defined (WIN32) || defined(_NX64)
66 static ns32 threadEntryPoint(void* pIn);
67#endif //WIN32 || _NX64
68
70 //------------------------------------------------------------
72 //------------------------------------------------------------
74public:
76 GX_FORCE_INLINE b32 isLive( void ) const { return _isLive; }
77
79 //------------------------------------------------------------
81 //------------------------------------------------------------
83private:
84 void* _pIn;
85 b32 _isLive;
86
87#if defined(_PS4)
88 GxNativeThread _id;
89#elif defined(WIN32)
90 HANDLE _handle;
91 nu32 _id;
92#endif // WIN32
93
95};
96
97GX_P2P_NAMESPACE_END()
Thread抽象基底クラス
Definition GxP2PThread.h:20
virtual void threadMain(void *pIn)=0
スレッド関数
GX_FORCE_INLINE b32 isLive(void) const
生存判定取得
Definition GxP2PThread.h:76
32bitブーリアン
Definition GxDefine.h:173