![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cThreadMgr.h>
Public Member Functions | |
cThreadLockFast & | ref_LockThreads () noexcept |
cThreadPtr | GetThreadForId (THREADID_t nThreadID) const noexcept |
bool | IsValidThreadId (THREADID_t nThreadID) noexcept |
cThread * | GetCurrentThread () const noexcept |
HRESULT | CheckAllThreads () |
check m_aThreads against real system threads. More... | |
void | Register (IThreadCloseHandler *pLocal) |
void | UnRegister (IThreadCloseHandler *pLocal) |
![]() | |
virtual | ~CObject () |
virtual bool | isValidCheck () const noexcept |
< memory allocation and structure definitions are valid. More... | |
virtual void | AssertValid () const |
< memory allocation and structure definitions are valid. More... | |
virtual void | Serialize (cArchive &a) |
![]() | |
cHeapObject () | |
virtual | ~cHeapObject () |
bool | IsValidInsideN (INT_PTR index) const |
bool | IsValidInsidePtr (void const *pTest) const |
virtual size_t | GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const |
virtual bool | isValidCheck () const noexcept |
Protected Member Functions | |
cThreadMgr () | |
~cThreadMgr () | |
![]() | |
cSingleton (cThreadMgr *pObject, const TYPEINFO_t &rAddrCode=typeid(cThreadMgr)) noexcept | |
virtual | ~cSingleton () |
![]() | |
cSingletonStatic (TYPE *pObject) noexcept | |
virtual | ~cSingletonStatic () noexcept |
![]() | |
cSingletonRegister (const TYPEINFO_t &rAddrCode) noexcept | |
virtual | ~cSingletonRegister () |
void | RegisterSingleton () |
![]() | |
const void * | get_HeapPtr () const noexcept override |
Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More... | |
Protected Attributes | |
cThreadLockFast | m_LockThreads |
lock the whole threading system. to start/stop threads. More... | |
cArraySortHash< cThread, THREADID_t > | m_aThreads |
just store array of pointers for each cThread. acts the same as a thread local type. More... | |
cArrayPtr< IThreadCloseHandler > | m_aThreadCloseHandlers |
array of callbacks to notify when a thread closes. e.g. cleanup thread local stuff ? More... | |
![]() | |
HMODULE | m_hModuleLoaded |
What modules loaded this ? So singletons can be destroyed if DLL/SO unloads. More... | |
Friends | |
class | cSingleton< cThreadMgr > |
class | cThread |
Additional Inherited Members | |
![]() | |
static cThreadMgr *__stdcall | get_Single () |
static TYPE2 *__stdcall | get_SingleT () |
static cThreadMgr &__stdcall | I () |
![]() | |
static bool | isSingleCreated () noexcept |
static TYPE * | get_SingleU () noexcept |
static TYPE * | get_Single () |
template<class TYPE2 > | |
static TYPE2 *__stdcall | get_SingleCast () |
static TYPE & | I () noexcept |
![]() | |
static void __stdcall | ReleaseModule (HMODULE hMod) |
![]() | |
static cThreadLockFast | sm_LockSingle |
common lock for all cSingleton. More... | |
![]() | |
static TYPE * | sm_pThe = nullptr |
pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More... | |
Singleton structure for tracking all active threads for the app. an array of cThread structures. used to cross reference threads with thread locals such that thread locals are destroyed when the thread is destroyed.
|
protected |
|
protected |
HRESULT GrayLib::cThreadMgr::CheckAllThreads | ( | ) |
check m_aThreads against real system threads.
Threads can get destroyed without proper notification. periodically check to see if the threads are still truly valid in the system ?
|
noexcept |
|
noexcept |
|
inlinenoexcept |
Is this a valid thread id in my list? might still be valid system id ?
|
inlinenoexcept |
lock the whole threading system. to start/stop/register threads. Danger!
void GrayLib::cThreadMgr::Register | ( | IThreadCloseHandler * | pLocal | ) |
register a new type of thread local. stores 1 per new thread.
void GrayLib::cThreadMgr::UnRegister | ( | IThreadCloseHandler * | pLocal | ) |
get rid of a thread local data type for all threads.
|
friend |
|
friend |
|
protected |
array of callbacks to notify when a thread closes. e.g. cleanup thread local stuff ?
|
protected |
just store array of pointers for each cThread. acts the same as a thread local type.
|
mutableprotected |
lock the whole threading system. to start/stop threads.