mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-21 18:11:32 +03:00
30a6a8b837
timeout never times out and CTimerThread is a no-op.
31 lines
561 B
C++
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
|
|
|