Proud::CTimerThread Class Reference

Public Member Functions

 CTimerThread (Thread::ThreadProc threadProc, uint32_t interval, void *ctx)
 
 ~CTimerThread ()
 
void Start ()
 
void Stop ()
 

Public Attributes

bool m_useComModel
 

Detailed Description

If you want to have a specific routine to run at a specific time, use CTimerThread or CTimerQueue.

  • CTimerThread runs a timer callback function at specific times. But callback only happens in a single thread.
  • CTimerQueue allows callback to start in a different thread at specific times even thoud the previous timer callback hasn't been returned.

Constructor & Destructor Documentation

Proud::CTimerThread::CTimerThread ( Thread::ThreadProc  threadProc,
uint32_t  interval,
void *  ctx 
)

Creator and timer thead do not start here.

Parameters
threadProca function that gets called at an user-defined specific time.
intervalTimer cycle in millisecond.
ctxA factor tht gets passed on when threadProc is running. This needs to be defined by user.
Proud::CTimerThread::~CTimerThread ( )

Shuts down timer thread before destruction.

Member Function Documentation

void Proud::CTimerThread::Start ( )

Starts the operation of timer thread.

void Proud::CTimerThread::Stop ( )

Stops the operation of timer thread and wait until a thread gets destructed.