OROCHI
 
Loading...
Searching...
No Matches
GxThread Class Referenceabstract

スレッドクラス More...

#include <GxThread.h>

Inheritance diagram for GxThread:
Collaboration diagram for GxThread:

Public Member Functions

初期化

ハードウェアスレッド最大数

 GxThread (void)
 コンストラクタ
 
 ~GxThread (void) override
 デストラクタ
 
- Public Member Functions inherited from GxClassBase
constexpr GxClassBase (void)
 コンストラクタ
 
constexpr GxClassBase (const GxClassBase &base)
 コピーコンストラクタ
 
 ~GxClassBase (void) override
 デストラクタ
 
- Public Member Functions inherited from GxClassBaseRoot
constexpr GxClassBaseRoot (void)
 コンストラクタ
 
constexpr GxClassBaseRoot (const GxClassBaseRoot &)
 コピーコンストラクタ
 
virtual ~GxClassBaseRoot (void)
 デストラクタ
 
constexpr GxClassBaseRootoperator= (const GxClassBaseRoot &)
 代入演算子
 
virtual GxRttigetRtti (void) const =0
 Rttiの取得
 
virtual GX_FORCE_INLINE const GxTypedObjectgetDefaultObject (void)
 デフォルトオブジェクトを取得
 
GX_FORCE_INLINE b32 isDefaultObject (void)
 デフォルトオブジェクト判定
 

定義

enum class  PRIORITY {
  LOW = -2 , BELOW , NORMAL , ABOVE ,
  HIGH , MAX = 5
}
 優先度 More...
 
static constexpr u32 THREAD_MAX = GxMath::VALUE_32
 スレッドの最大数
 
static constexpr u32 INVALID_INDEX = 0xFFFFFFFF
 無効スレッドインデックス
 
static constexpr u32 MAIN_THREAD_INDEX = 0
 メインスレッドインデックス
 

メンバ変数

static GxThread_pThread [THREAD_MAX] = {nullptr}
 スレッド自身のポインタ
 
static u32 _num = 0
 作ったスレッド数
 
GxNativeThread _threadId
 スレッドID
 

アクセサ

b32 isStop (void) const
 停止中か判定
 
constexpr u32 getIndex (void) const
 インデックスを取得
 
constexpr GxRandomgetRandomGenerator (void) const
 乱数発生器を取得
 
static GxThreadgetCurrentThread (void)
 カレントスレッドを取得
 
static GX_FORCE_INLINE void setFixThread (b32 on)
 スレッドのCPUを固定するか設定
 
static GX_FORCE_INLINE b32 isFixThread (void)
 スレッドのCPUを固定するか判定
 

操作

b32 create (void *pIn, PRIORITY priority, u32 stackSize, s32 cpuIndex=-1)
 作成
 
void suspend (void)
 サスペンド
 
void resume (void)
 サスペンドから復帰
 
static b32 casU32 (volatile u32 *pTarget, u32 oldValue, u32 newValue)
 符号なし32bit整数CAS(Compare-And-Swap)
 
static b32 casPointer (volatile void **ppTarget, void *pOld, void *pNew)
 ポインタCAS(Compare-And-Swap)
 
static void barrierMemory (void)
 メモリバリア
 
static void atomicExchangeU32 (volatile u32 *pTarget, u32 newValue)
 アトミックU32
 
static void sleep (u32 milliSecond)
 スリープ
 
virtual void createCallback (void)
 作成時のコールバック関数
 
virtual void threadMain (void *pArgument)=0
 メインループ
 
void stop (void)
 停止(スレッド外からの呼び出し禁止)
 

Additional Inherited Members

- Static Public Member Functions inherited from GxClassBaseRoot
static GX_FORCE_INLINE GxRtti__getStaticRtti (void)
 Rttiの取得
 

Detailed Description

スレッドクラス

Member Enumeration Documentation

◆ PRIORITY

enum class GxThread::PRIORITY
strong

優先度

Enumerator
LOW 

最低優先

BELOW 

低優先

NORMAL 

普通

ABOVE 

優先

HIGH 

最優先

MAX 

定義数

Member Function Documentation

◆ atomicExchangeU32()

void GxThread::atomicExchangeU32 ( volatile u32 * pTarget,
u32 newValue )
static

アトミックU32

Parameters
pTarget[in] 対象
newValue[in] 設定値
Here is the call graph for this function:

◆ casPointer()

b32 GxThread::casPointer ( volatile void ** ppTarget,
void * pOld,
void * pNew )
static

ポインタCAS(Compare-And-Swap)

Parameters
ppTarget[in] 対象
pOld[in] 変換前の値
pNew[in] 変換後の値
Returns
成功ならtrue
Here is the caller graph for this function:

◆ casU32()

b32 GxThread::casU32 ( volatile u32 * pTarget,
u32 oldValue,
u32 newValue )
static

符号なし32bit整数CAS(Compare-And-Swap)

Parameters
pTarget[in] 対象
oldValue[in] 変換前の値
newValue[in] 変換後の値
Returns
成功ならtrue
Here is the caller graph for this function:

◆ create()

b32 GxThread::create ( void * pIn,
PRIORITY priority,
u32 stackSize,
s32 cpuIndex = -1 )

作成

Parameters
pArgument[in] 引数
priority[in] 優先度
stackSize[in] スタックサイズ
cpuIndex[in] CPUインデックス
name[in] スレッド名
profile[in] プロファイルするならtrue
Returns
成功か
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCallback()

virtual void GxThread::createCallback ( void )
inlineprotectedvirtual

作成時のコールバック関数

Reimplemented in GxWorkerThread.

Here is the caller graph for this function:

◆ getCurrentThread()

GxThread * GxThread::getCurrentThread ( void )
static

カレントスレッドを取得

Returns
カレントスレッド
Here is the caller graph for this function:

◆ isStop()

b32 GxThread::isStop ( void ) const

停止中か判定

Returns
停止中ならtrue
Here is the caller graph for this function:

◆ sleep()

void GxThread::sleep ( u32 milliSecond)
static

スリープ

Parameters
milliSecond[in] スリープ時間(ミリ秒)
Here is the caller graph for this function:

◆ threadMain()


The documentation for this class was generated from the following files: