⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 condition.h

📁 linux下的线程池,其中使用了条件变量,互斥锁等保持线程同步的变量!
💻 H
字号:
#ifndef _CONDITION_H_INCLUDE_
#define _CONDITION_H_INCLUDE_
#ifndef WIN32

#include <pthread.h>

#endif
class Mutex;
class Condition
{
public:
	Condition(Mutex&mutex);
	virtual ~Condition();
public:
	bool signal();
	bool broadcast();
	bool wait();
	int timedwait(const struct timespec* pabstime);

	
protected:
private:
#ifndef WIN32
	pthread_cond_t cond_;	
#endif
	Mutex& mutex_;
};
#endif

⌨️ 快捷键说明

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