5 #ifndef _INC_cThreadMgr_H
6 #define _INC_cThreadMgr_H
21 virtual void OnThreadClose(THREADID_t nThreadID) = 0;
43 bool AddThread(
cThread* pThread);
44 bool RemoveThreadId(THREADID_t nThreadId);
45 bool RemoveThread(
cThread* pThread);
46 void ClearTerminatedThreadId(THREADID_t nThreadId);
60 cThreadPtr GetThreadForId(THREADID_t nThreadID)
const noexcept;
67 cThreadPtr pThread = GetThreadForId(nThreadID);
68 if (pThread ==
nullptr)
76 cThread* GetCurrentThread() const noexcept;
#define IGNORE_WARN_INTERFACE(c)
Definition: GrayCore.h:79
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
#define CHEAPOBJECT_IMPL
Definition: cHeapObject.h:32
Definition: cThreadMgr.h:26
cThreadLockFast & ref_LockThreads() noexcept
Definition: cThreadMgr.h:53
cArrayPtr< IThreadCloseHandler > m_aThreadCloseHandlers
array of callbacks to notify when a thread closes. e.g. cleanup thread local stuff ?
Definition: cThreadMgr.h:40
cThreadLockFast m_LockThreads
lock the whole threading system. to start/stop threads.
Definition: cThreadMgr.h:38
cArraySortHash< cThread, THREADID_t > m_aThreads
just store array of pointers for each cThread. acts the same as a thread local type.
Definition: cThreadMgr.h:39
bool IsValidThreadId(THREADID_t nThreadID) noexcept
Definition: cThreadMgr.h:61
Definition: cArraySortRef.h:60
Definition: cRefPtr.h:225
Definition: cSingleton.h:127
static const THREADID_t k_NULL
Not a valid thread Id.
Definition: cThreadLock.h:64
Definition: cThreadLock.h:205
Definition: cThreadMgr.h:16
MIDL_INTERFACE("0C3E2E71-B93C-11d2-AAD0-006007654304") IScriptableObj