Jthread.h
#define JTHREAD_H
#include “jmutex.h”
//#include <pthread.h>
//#include “utils/threads.h”
//extern “C” int pthread_cancel(pthread_t thread);//??
#define ERR_JTHREAD_CANTINITMUTEX -1
#define ERR_JTHREAD_CANTSTARTTHREAD -2
#define ERR_JTHREAD_THREADFUNCNOTSET -3
#define ERR_JTHREAD_NOTRUNNING -4
#define ERR_JTHREAD_ALREADYRUNNING -5
class JThread
{
public:
JThread();
virtual ~JThread();
int Start();
int Kill();
virtual void *Thread() = 0;
bool IsRunning();
void *GetReturnValue();
protected:
void ThreadStarted();
private:
版权声明:本文为procedurecode原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。