barrier/mt/CTimerThread.h
crs 30a6a8b837 CTimerThread now allows zero and negative timeouts. a negative
timeout never times out and CTimerThread is a no-op.
2002-06-09 22:20:01 +00:00

31 lines
561 B
C++

#ifndef CTIMERTHREAD_H
#define CTIMERTHREAD_H
#include "common.h"
class CThread;
class CTimerThread {
public:
// cancels the calling thread after timeout seconds unless destroyed
// before then. if timeout is less than zero then it never times
// out and is a no-op.
CTimerThread(double timeout);
~CTimerThread();
private:
void timer(void*);
// not implemented
CTimerThread(const CTimerThread&);
CTimerThread& operator=(const CTimerThread&);
private:
double m_timeout;
CThread* m_callingThread;
CThread* m_timingThread;
};
#endif