oamrunner.h
来自「面向对象封装 POSIX timer---------------」· C头文件 代码 · 共 85 行
H
85 行
#ifndef OAMRUNNER_H_
#define OAMRUNNER_H_
#include <pthread.h>
class OamRunner;
class OamThreadRunner
{
public:
// the definition of the thread status
enum
{
RUN,
PEND,
STOP
};
OamThreadRunner();
virtual ~OamThreadRunner();
bool stop();
bool start(OamRunner * runner);
bool suspend();
bool resume();
bool wait();
bool isRunning();
pthread_t self();
private:
static void * threadFunc(void * args);
// the thread id
pthread_t tid_m;
// the status of the thread
int status_m;
};
class OamRunner
{
friend class OamThreadRunner;
public:
OamRunner();
virtual ~OamRunner();
virtual bool stop();
virtual bool start();
virtual bool suspend();
virtual bool resume();
virtual bool wait();
virtual bool isRunning();
pthread_t self();
protected:
virtual int run();
private:
// the object of the runner helper.
OamThreadRunner runner_m;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?