| 25 | ThreadMgr::~ThreadMgr() { } |
| 26 | |
| 27 | void ThreadMgr::Reset(const int nThreads) |
| 28 | { |
| 29 | const unsigned n = static_cast<unsigned>(nThreads); |
| 30 | if (n > numRealThreads) |
| 31 | { |
| 32 | realThreads.resize(n); |
| 33 | for (unsigned t = numRealThreads; t < n; t++) |
| 34 | realThreads[t] = false; |
| 35 | numRealThreads = n; |
| 36 | } |
| 37 | |
| 38 | if (n > numMachineThreads) |
| 39 | { |
| 40 | machineThreads.resize(n); |
| 41 | for (unsigned t = numMachineThreads; t < n; t++) |
| 42 | machineThreads[t] = -1; |
| 43 | numMachineThreads = n; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | |
| 48 | int ThreadMgr::Occupy(const int machineId) |
nothing calls this directly
no outgoing calls
no test coverage detected