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.
PROUD_API Proud::CTimerThread::CTimerThread |
( |
Thread::ThreadProc |
threadProc, |
|
|
uint32_t |
interval, |
|
|
void * |
ctx |
|
) |
| |
Creator and timer thead do not start here.
- Parameters
-
threadProc | a function that gets called at an user-defined specific time. |
interval | Timer cycle in millisecond. |
ctx | A 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.
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.