BaseThread.h 562 Bytes
#ifndef BASE_THREAD_CLASS_H
#define BASE_THREAD_CLASS_H

#include <string>
#include <pthread.h>
#include "BaseEvent.h"

class CBaseThread
{
public:
    CBaseThread();
    virtual ~CBaseThread();

    virtual int Run();
    BOOL BeginThread();
    void JoinThread();

public:
    void Shutdown(BOOL bWatiForShutdown = TRUE);

public:
    virtual BOOL InitInstance();
    virtual int ExitInstance();

protected:
    BOOL IsStopping(DWORD nTimeOut = 10);

protected:
    pthread_t m_thread;
    CBaseEvent m_StopEvent;

};

#endif