philosopher.h
来自「用c++包装好的线程库,直接拿来使用,提高效率.」· C头文件 代码 · 共 30 行
H
30 行
#ifndef _PHILOSOPHER#define _PHILOSOPHER#include <thread.h>#include <iostream>#include <string>#include "dining.h"using namespace std;using namespace cpp_threads;class philosopher : public Pthread { private: int _nr; int _count; int _forks; dining *application; Mutex *p_fork; public: philosopher(int n, int forks, void *arg); ~philosopher(); int thread(void *);};#endif /* PHILOSOPHER */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?