7 #ifndef _INC_cJobThreadSet_H
8 #define _INC_cJobThreadSet_H
56 ASSERT(pThread !=
nullptr);
57 ASSERT(pThread->get_Job() ==
nullptr);
59 return m_aFree.
Add(pThread);
66 for (
int i = 0; i < m_aFree.
GetSize(); i++)
68 m_aFree.
GetAtCheck(i)->RequestStopThread(
true);
90 inline cJobThreadSet(
int iMinThreads = 0,
int iMaxThreads = 32) noexcept
91 : m_iMinThreads(iMinThreads)
92 , m_iMaxThreads(iMaxThreads)
98 return m_aRunningThreads.
GetSize();
102 return m_WaitingJobs.
GetSize();
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define ASSERT(exp)
Definition: cDebugAssert.h:87
#define CHEAPOBJECT_IMPL
Definition: cHeapObject.h:32
Definition: cJobBase.h:175
Definition: cJobThreadSet.h:21
~cJobThreadPool()
Definition: cJobThreadSet.h:40
ITERATE_t get_FreeThreadQty() const noexcept
Definition: cJobThreadSet.h:45
cJobThreadPool()
Definition: cJobThreadSet.h:36
void ClearFreeThreads()
Definition: cJobThreadSet.h:61
ITERATE_t AddFreeThread(T *pThread)
Definition: cJobThreadSet.h:54
cRefPtr< T > PopFreeThread()
Definition: cJobThreadSet.h:49
Definition: cJobThreadSet.h:76
cJobArray m_WaitingJobs
cJobBase to schedule some TIME later. (not yet occupying a Thread.)
Definition: cJobThreadSet.h:87
cArrayRef< T > m_aRunningThreads
Active Threads currently running/sleeping on Jobs/scripts. Idle threads get returned back to the shar...
Definition: cJobThreadSet.h:85
cJobThreadSet(int iMinThreads=0, int iMaxThreads=32) noexcept
Definition: cJobThreadSet.h:90
const int m_iMinThreads
min Threads i should keep in a pool ready to go. TODO
Definition: cJobThreadSet.h:82
ITERATE_t get_WaitingJobQty() const noexcept
Definition: cJobThreadSet.h:100
ITERATE_t get_RunningJobQty() const noexcept
Definition: cJobThreadSet.h:96
const int m_iMaxThreads
max total Threads I'm allowed to use for this set.
Definition: cJobThreadSet.h:83
ITERATE_t GetSize() const noexcept
Definition: cArray.h:137
Definition: cRefPtr.h:225
Definition: cSingleton.h:127
bool HasArg(TYPE *pObj) const
Definition: cThreadArray.h:138
cRefPtr< TYPE > GetAtCheck(ITERATE_t nIndex) const
Definition: cThreadArray.h:117
void RemoveAll()
Definition: cThreadArray.h:162
cRefPtr< TYPE > PopTail()
Definition: cThreadArray.h:132
ITERATE_t GetSize() const
Definition: cThreadArray.h:110
cThreadLockCount m_Lock
Definition: cThreadArray.h:101
ITERATE_t Add(TYPE *pObj)
Definition: cThreadArray.h:144
ITERATE_t GetSize() const
Definition: cThreadArray.h:346
int ITERATE_t
like size_t but signed
Definition: Index.h:28