rendered paste bodyclass CThread {
public:
CThread() {};
virtual ~CThread() {};
int Create(void *arg);
protected:
static void *EntryPoint(void *);
virtual void Execute(void *arg);
void *Arg() const {return m_arg;}
void Arg(void *a) {m_arg = a;}
private:
pthread_t m_threadId;
void *m_arg;
};
int CThread::Create(void *arg) {
int retval;
Arg(arg);
retval = pthread_create(&m_threadId, NULL, CThread::EntryPoint, this);
return retval;
}
void *CThread::EntryPoint(void *pthis) {
CThread *pt = (CThread *)pthis;
pt->Execute( pt->Arg() );
return NULL;
}
void CThread::Execute(void *arg)
{
}