62 ThreadLoop::ThreadLoop()
69 ThreadLoop::~ThreadLoop()
81 m_p->m_start = a_startIdx;
82 m_p->m_nIter = a_numIter;
83 m_p->m_cntPtr = a_cntPtr;
98 m_p->m_curIdx =
m_p->m_start;
99 for (
int i = 0; i <
m_p->m_nIter; ++i, ++
m_p->m_curIdx, ++(*
m_p->m_cntPtr))
void DoWork()
Executes the work of the thread.
int m_curIdx
current index the thread is executing
int * m_cntPtr
pointer to a counter for this thread, updated on each iteration
int CurrIdx()
Returns the current index of the thread.
BSHP< impl > m_p
implementation class
Implementation of ThreadLoop.
int m_start
starting index for the thread
void SetStartNumIterCnt(int a_startIdx, int a_numIter, int *a_cntPtr)
Sets up the thread worker.
int m_nIter
number of interations for the thread to perform
virtual void Worker()=0
Overridden by derived class.