| 162 | |
| 163 | private: |
| 164 | inline void Start(size_t num, size_t maxque) { |
| 165 | ShouldTerminate.store(false); |
| 166 | MaxQueueSize = maxque; |
| 167 | ThreadCountExpected = num; |
| 168 | |
| 169 | try { |
| 170 | for (size_t i = 0; i < num; ++i) { |
| 171 | Tharr.push_back(Parent_->Pool()->Run(this)); |
| 172 | ++ThreadCountReal; |
| 173 | } |
| 174 | } catch (...) { |
| 175 | Stop(); |
| 176 | |
| 177 | throw; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | inline void Stop() { |
| 182 | ShouldTerminate.store(true); |