| 33 | } |
| 34 | |
| 35 | void ThreadPool::destroy() { |
| 36 | std::lock_guard<std::mutex> _l(gInitMutex); |
| 37 | for (auto i= gInstances.begin(); i != gInstances.end(); i++){ |
| 38 | if (i->second){ |
| 39 | delete i->second; |
| 40 | } |
| 41 | } |
| 42 | gInstances.clear(); |
| 43 | } |
| 44 | |
| 45 | ThreadPool::ThreadPool(int numberThread) { |
| 46 | mNumberThread = numberThread; |