Started over.

This commit is contained in:
crs
2001-10-06 14:13:28 +00:00
parent 27ead1f713
commit ff81f708e2
132 changed files with 7634 additions and 3960 deletions

30
mt/CTimerThread.cpp Normal file
View File

@@ -0,0 +1,30 @@
#include "CTimerThread.h"
#include "CThread.h"
#include "TMethodJob.h"
#include <assert.h>
//
// CTimerThread
//
CTimerThread::CTimerThread(double timeout) : m_timeout(timeout)
{
assert(m_timeout > 0.0);
m_callingThread = new CThread(CThread::getCurrentThread());
m_timingThread = new CThread(new TMethodJob<CTimerThread>(
this, &CTimerThread::timer));
}
CTimerThread::~CTimerThread()
{
m_timingThread->cancel();
delete m_timingThread;
delete m_callingThread;
}
void CTimerThread::timer(void*)
{
CThread::sleep(m_timeout);
m_callingThread->cancel();
}