| 129 | } |
| 130 | |
| 131 | bool UnixFork::createProcess(bool respawn) |
| 132 | { |
| 133 | if (respawn) { |
| 134 | m_recreateWorker.removeIf([this, respawn](Worker worker) { |
| 135 | worker.restart = 0; |
| 136 | if (!createChild(worker, respawn)) { |
| 137 | std::cout << "CHEAPING worker: " << worker.id << '\n'; |
| 138 | --m_processes; |
| 139 | } |
| 140 | |
| 141 | return true; // Clean recreate worker list |
| 142 | }); |
| 143 | } else { |
| 144 | for (int i = 0; i < m_processes; ++i) { |
| 145 | Worker worker; |
| 146 | worker.id = i + 1; |
| 147 | worker.null = false; |
| 148 | createChild(worker, respawn); |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | return !m_childs.empty(); |
| 153 | } |
| 154 | |
| 155 | void UnixFork::decreaseWorkerRespawn() |
| 156 | { |
nothing calls this directly
no outgoing calls
no test coverage detected