thread.h

来自「LINUX下很好的C++线程池源码类」· C头文件 代码 · 共 38 行

H
38
字号
// Author:onebird
// Date 2006.08.22
// For Cross Thread Pool Class
//////////////////////////////////////////////////////////////////////
#ifndef _THREAD_H_
#define _THREAD_H_
#include "mthread.h"
#include "mutex.h"
//#include <pthread.h>

#include "threadjob.h"
#include "threadpool.h"


class ThreadPool;
class Thread
{
public:
////	static long get_threadcount(bool finc, bool finit = false);
	bool Create();
	inline  ThreadPool * get_threadpool() {
		return m_pthreadPool;
	}
	void run();
	Thread( ThreadPool * pPool );
	virtual ~Thread();

protected:
	//unsigned int m_threadid;
	//pthread_t m_thread;
	ThreadPool * m_pthreadPool ;
	MThread m_thread;
	MMutex  m_mutex;
	bool m_fquit;
};

#endif 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?