Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cJobThreadPool< T > Class Template Reference

#include <cJobThreadSet.h>

Inheritance diagram for GrayLib::cJobThreadPool< T >:
Gray::cSingleton< cJobThreadPool< T > > Gray::cSingletonStatic< TYPE > Gray::cSingletonRegister Gray::CObject Gray::cHeapObject Gray::IHeapObject

Public Member Functions

ITERATE_t get_FreeThreadQty () const noexcept
 
cRefPtr< T > PopFreeThread ()
 
ITERATE_t AddFreeThread (T *pThread)
 
void ClearFreeThreads ()
 
- Public Member Functions inherited from Gray::CObject
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)
 
- Public Member Functions inherited from Gray::cHeapObject
 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

 cJobThreadPool ()
 
 ~cJobThreadPool ()
 
- Protected Member Functions inherited from Gray::cSingleton< cJobThreadPool< T > >
 cSingleton (cJobThreadPool< T > *pObject, const TYPEINFO_t &rAddrCode=typeid(cJobThreadPool< T >)) noexcept
 
virtual ~cSingleton ()
 
- Protected Member Functions inherited from Gray::cSingletonStatic< TYPE >
 cSingletonStatic (TYPE *pObject) noexcept
 
virtual ~cSingletonStatic () noexcept
 
- Protected Member Functions inherited from Gray::cSingletonRegister
 cSingletonRegister (const TYPEINFO_t &rAddrCode) noexcept
 
virtual ~cSingletonRegister ()
 
void RegisterSingleton ()
 
- Protected Member Functions inherited from Gray::cHeapObject
const void * get_HeapPtr () const noexcept override
 Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More...
 

Friends

class cSingleton< cJobThreadPool< T > >
 

Additional Inherited Members

- Static Public Member Functions inherited from Gray::cSingleton< cJobThreadPool< T > >
static cJobThreadPool< T > *__stdcall get_Single ()
 
static TYPE2 *__stdcall get_SingleT ()
 
static cJobThreadPool< T > &__stdcall I ()
 
- Static Public Member Functions inherited from Gray::cSingletonStatic< TYPE >
static bool isSingleCreated () noexcept
 
static TYPEget_SingleU () noexcept
 
static TYPEget_Single ()
 
template<class TYPE2 >
static TYPE2 *__stdcall get_SingleCast ()
 
static TYPEI () noexcept
 
- Static Public Member Functions inherited from Gray::cSingletonRegister
static void __stdcall ReleaseModule (HMODULE hMod)
 
- Static Public Attributes inherited from Gray::cSingletonRegister
static cThreadLockFast sm_LockSingle
 common lock for all cSingleton. More...
 
- Protected Attributes inherited from Gray::cSingletonRegister
HMODULE m_hModuleLoaded
 What modules loaded this ? So singletons can be destroyed if DLL/SO unloads. More...
 
- Static Protected Attributes inherited from Gray::cSingletonStatic< TYPE >
static TYPEsm_pThe = nullptr
 pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More...
 

Detailed Description

template<class T>
class GrayLib::cJobThreadPool< T >

Manage single / shared pool of free/idle fibers/threads that any cJobFiberMgr/cJobThreadMgr/cJobThreadSet can use.

Constructor & Destructor Documentation

◆ cJobThreadPool()

template<class T >
GrayLib::cJobThreadPool< T >::cJobThreadPool ( )
inlineprotected

◆ ~cJobThreadPool()

template<class T >
GrayLib::cJobThreadPool< T >::~cJobThreadPool ( )
inlineprotected

Member Function Documentation

◆ AddFreeThread()

template<class T >
ITERATE_t GrayLib::cJobThreadPool< T >::AddFreeThread ( T *  pThread)
inline

◆ ClearFreeThreads()

template<class T >
void GrayLib::cJobThreadPool< T >::ClearFreeThreads ( )
inline

signal to close all my threads. don't bother waiting for them to actually close.

◆ get_FreeThreadQty()

template<class T >
ITERATE_t GrayLib::cJobThreadPool< T >::get_FreeThreadQty ( ) const
inlinenoexcept

◆ PopFreeThread()

template<class T >
cRefPtr<T> GrayLib::cJobThreadPool< T >::PopFreeThread ( )
inline

Friends And Related Function Documentation

◆ cSingleton< cJobThreadPool< T > >

template<class T >
friend class cSingleton< cJobThreadPool< T > >
friend

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