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

📄 singlethreadchecking.h

📁 遗传算法的一个库
💻 H
字号:
#ifndef __GradSoft_ThreadService_SingleThreadChecking_h#define __GradSoft_ThreadService_SingleThreadChecking_h/* * part of GradSoft C++ ToolBox: Threading * (C) GradSoft 2001 * http://www.gradsoft.com.ua * $Id: SingleThreadChecking.h,v 1.5 2001/10/31 03:13:49 rssh Exp $ */#ifndef __GradSoft_ThreadService_h#include <GradSoft/ThreadService.h>#endif#ifndef __GradSoft_Thread_h#include <GradSoft/Thread.h>#endif#ifndef __GradSoft_ThreadEvent_h#include <GradSoft/ThreadEvent.h>#endifnamespace GradSoft {/** * Single thread service wich run in own thread and check * aviability of service before processing of runnable **/class SingleThreadChecking: public ThreadService, public Thread{private:  Runnable*   current_;  Mutex       currentMutex_;  ThreadEvent runnableArrived_;public:  SingleThreadChecking();  ~SingleThreadChecking();   /**   * process runnable, if worker thread is aviable, than   * process it immediatly, otherwise throw ResourceTemporaryNotAviable   * exception.   **/  void process(Runnable* runnable);  void  activate();    void  deactivate(bool shutdown);protected:  void run();};}#endif

⌨️ 快捷键说明

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