mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Fixed thread statics.
This commit is contained in:
parent
2554cf6c1a
commit
4110fe51b2
1 changed files with 3 additions and 1 deletions
|
|
@ -52,6 +52,7 @@ public:
|
||||||
static const U32 getListIndex(){ return mListIndex; }
|
static const U32 getListIndex(){ return mListIndex; }
|
||||||
|
|
||||||
virtual void *getMemInstPtr() = 0;
|
virtual void *getMemInstPtr() = 0;
|
||||||
|
virtual const void *getConstMemInstPtr() const = 0;
|
||||||
virtual const dsize_t getMemInstSize() const = 0;
|
virtual const dsize_t getMemInstSize() const = 0;
|
||||||
|
|
||||||
#ifdef TORQUE_ENABLE_THREAD_STATIC_METRICS
|
#ifdef TORQUE_ENABLE_THREAD_STATIC_METRICS
|
||||||
|
|
@ -143,6 +144,7 @@ private:
|
||||||
public:
|
public:
|
||||||
TorqueThreadStatic( T instanceVal ) : mInstance( instanceVal ) {}
|
TorqueThreadStatic( T instanceVal ) : mInstance( instanceVal ) {}
|
||||||
virtual void *getMemInstPtr() { return &mInstance; }
|
virtual void *getMemInstPtr() { return &mInstance; }
|
||||||
|
virtual const void *getConstMemInstPtr() const { return &mInstance; }
|
||||||
|
|
||||||
// I am not sure these are needed, and I don't want to create confusing-to-debug code
|
// I am not sure these are needed, and I don't want to create confusing-to-debug code
|
||||||
#if 0
|
#if 0
|
||||||
|
|
@ -181,7 +183,7 @@ public: \
|
||||||
_##name##TorqueThreadStatic() : TorqueThreadStatic<type>( initalvalue ) {} \
|
_##name##TorqueThreadStatic() : TorqueThreadStatic<type>( initalvalue ) {} \
|
||||||
virtual const dsize_t getMemInstSize() const { return sizeof( type ); } \
|
virtual const dsize_t getMemInstSize() const { return sizeof( type ); } \
|
||||||
type &_cast() { return *reinterpret_cast<type *>( getMemInstPtr() ); } \
|
type &_cast() { return *reinterpret_cast<type *>( getMemInstPtr() ); } \
|
||||||
const type &_const_cast() const { return *reinterpret_cast<const type *>( getMemInstPtr() ); } \
|
const type &_const_cast() const { return *reinterpret_cast<const type *>( getConstMemInstPtr() ); } \
|
||||||
}; \
|
}; \
|
||||||
static _##name##TorqueThreadStatic name##TorqueThreadStatic; \
|
static _##name##TorqueThreadStatic name##TorqueThreadStatic; \
|
||||||
static _TorqueThreadStaticReg _##name##TTSReg( reinterpret_cast<_TorqueThreadStatic *>( & name##TorqueThreadStatic ) )
|
static _TorqueThreadStaticReg _##name##TTSReg( reinterpret_cast<_TorqueThreadStatic *>( & name##TorqueThreadStatic ) )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue