icinga2/base/thread.h

33 lines
372 B
C
Raw Normal View History

#ifndef THREAD_H
#define THREAD_H
2012-03-31 09:36:00 +02:00
namespace icinga
{
typedef void (*ThreadProc)(void *);
2012-04-22 16:45:31 +02:00
/**
* Thread
*
* A wrapper around OS-specific thread functionality.
*/
class I2_BASE_API Thread
2012-03-31 09:36:00 +02:00
{
private:
#ifdef _WIN32
HANDLE m_Thread;
#else
pthread_t m_Thread;
#endif
public:
2012-04-22 16:45:31 +02:00
Thread(ThreadProc callback);
~Thread(void);
2012-03-31 09:36:00 +02:00
void Join(void);
2012-03-31 09:36:00 +02:00
};
}
#endif /* THREAD_H */