You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
436 B
37 lines
436 B
#ifndef THREAD_HPP
|
|
#define THREAD_HPP
|
|
|
|
#include <pthread.h>
|
|
|
|
|
|
class Thread
|
|
{
|
|
public:
|
|
|
|
Thread();
|
|
virtual ~Thread();
|
|
|
|
void start();
|
|
void* join() const;
|
|
virtual void stop();
|
|
void sendSignal( const int nSignal ) const;
|
|
bool isRunning() const;
|
|
|
|
private:
|
|
|
|
virtual void* run() = 0;
|
|
static void* threadStarter( void* pData );
|
|
|
|
protected:
|
|
|
|
bool m_isRunning;
|
|
|
|
private:
|
|
|
|
pthread_t m_threadHandler;
|
|
|
|
};
|
|
|
|
|
|
#endif // THREAD_HPP
|