|
#include "stdafx.h"
#include "Threads\TimerThread.h"
namespace Threads
{
TimerThread::TimerThread()
{
}
TimerThread::TimerThread(int time, TimerCallback* timerCallback) :
m_timerCallback(timerCallback),
m_time(time)
{
}
TimerThread::~TimerThread()
{
this->Stop();
}
void TimerThread::Run()
{
while (!this->IsStopped())
{
Sleep(1000);
if (m_timerCallback)
{
m_timerCallback->OnTimer();
}
}
}
void TimerThread::Stop()
{
m_timerCallback = NULL;
Thread::Stop();
}
} // namespace Threads
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.