?? main.c
字號:
#include "shared_ptr.h"#include "lock.h"#include <iostream>#include <pthread.h>#include <string>#include <unistd.h>#include "thread.h"#include "threadpool.h"#include "myjob.h"using namespace std;using namespace util;#include "mythread.h"#include "myjob.h"int main(){ shared_ptr<ThreadPool> mPool = shared_ptr<ThreadPool>(new ThreadPool(5)); shared_ptr<BaseJob> mJob = shared_ptr<BaseJob>(new MyJob); string str; while(1) { cout<<"please input add ? \n"; cin>>str; if(str == "exit") break; else if(str == "stop") { mPool->stop(); cout<<"the pool is destroying.....\n"; } else if(str == "add") { for(int i = 0; i< 30; i++) mPool->addJob(mJob); } else cout<<"bad command .. \n"; } return 0;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -