Proud::CTimerThread Class Reference

Public Member Functions

PROUD_API CTimerThread (Thread::ThreadProc threadProc, uint32_t interval, void *ctx)
 
PROUD_API ~CTimerThread ()
 
PROUD_API void Start ()
 
PROUD_API 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_API 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_API Proud::CTimerThread::~CTimerThread ( )

Shuts down timer thread before destruction.

Member Function Documentation

PROUD_API void Proud::CTimerThread::Start ( )

Starts the operation of timer thread.

PROUD_API void Proud::CTimerThread::Stop ( )

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