| 255 | |
| 256 | template<class Jobs, class RetType> |
| 257 | inline |
| 258 | RunJobs<Jobs,RetType>::Master::Master(Jobs& j, unsigned int m_threads) |
| 259 | : n_threads(0), jobs(j), idx(0), sidx(-1), rs(heap) { |
| 260 | m.acquire(); |
| 261 | while ((n_threads < m_threads) && jobs()) { |
| 262 | if (stopped()) |
| 263 | break; |
| 264 | Thread::run(new Worker(jobs.job(),this,idx)); |
| 265 | n_threads++; idx++; |
| 266 | } |
| 267 | m.release(); |
| 268 | } |
| 269 | |
| 270 | template<class Jobs, class RetType> |
| 271 | inline bool |