philosopher.h
上传用户:shtangtang
上传日期:2007-01-04
资源大小:167k
文件大小:0k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifndef _PHILOSOPHER
  2. #define _PHILOSOPHER
  3. #include <string>
  4. #include <thread.h>
  5. #include "dining.h"
  6. class philosopher : public pthread {
  7.  private:
  8.   int _nr;
  9.   int _count;
  10.   int _forks;
  11.   dining *application;
  12.   mutex *p_fork;
  13.  public:
  14.   philosopher(int n, int forks, void *arg);
  15.   ~philosopher();
  16.   int thread(void *);
  17. };
  18. #endif /* PHILOSOPHER */